@@ -3720,11 +3720,6 @@ NeverNullType TypeResolver::resolveASTFunctionType(
37203720 Type thrownTy;
37213721 if (auto thrownTypeRepr = repr->getThrownTypeRepr ()) {
37223722 ASTContext &ctx = getASTContext ();
3723- if (!ctx.LangOpts .hasFeature (Feature::TypedThrows)) {
3724- diagnoseInvalid (
3725- thrownTypeRepr, thrownTypeRepr->getLoc (), diag::experimental_typed_throws);
3726- }
3727-
37283723 auto thrownTypeOptions = options.withoutContext ();
37293724 thrownTy = resolveType (thrownTypeRepr, thrownTypeOptions);
37303725 if (thrownTy->hasError ()) {
@@ -5694,10 +5689,6 @@ Type ExplicitCaughtTypeRequest::evaluate(
56945689 }
56955690
56965691 // We have an explicit thrown error type, so resolve it.
5697- if (!ctx.LangOpts .hasFeature (Feature::TypedThrows)) {
5698- ctx.Diags .diagnose (thrownTypeRepr->getLoc (), diag::experimental_typed_throws);
5699- }
5700-
57015692 auto options = TypeResolutionOptions (TypeResolverContext::None);
57025693 if (func->preconcurrency ())
57035694 options |= TypeResolutionFlags::Preconcurrency;
@@ -5713,11 +5704,6 @@ Type ExplicitCaughtTypeRequest::evaluate(
57135704 if (auto closure = catchNode.dyn_cast <ClosureExpr *>()) {
57145705 // Explicit thrown error type.
57155706 if (auto thrownTypeRepr = closure->getExplicitThrownTypeRepr ()) {
5716- if (!ctx.LangOpts .hasFeature (Feature::TypedThrows)) {
5717- ctx.Diags .diagnose (thrownTypeRepr->getLoc (),
5718- diag::experimental_typed_throws);
5719- }
5720-
57215707 return TypeResolution::resolveContextualType (
57225708 thrownTypeRepr, closure,
57235709 TypeResolutionOptions (TypeResolverContext::None),
@@ -5739,18 +5725,9 @@ Type ExplicitCaughtTypeRequest::evaluate(
57395725 // A do..catch block with no explicit 'throws' annotation will infer
57405726 // the thrown error type.
57415727 if (doCatch->getThrowsLoc ().isInvalid ()) {
5742- // Prior to typed throws, the do..catch always throws 'any Error'.
5743- if (!ctx.LangOpts .hasFeature (Feature::TypedThrows))
5744- return ctx.getErrorExistentialType ();
5745-
57465728 return Type ();
57475729 }
57485730
5749- if (!ctx.LangOpts .hasFeature (Feature::TypedThrows)) {
5750- ctx.Diags .diagnose (doCatch->getThrowsLoc (), diag::experimental_typed_throws);
5751- return ctx.getErrorExistentialType ();
5752- }
5753-
57545731 auto typeRepr = doCatch->getCaughtTypeRepr ();
57555732
57565733 // If there is no explicitly-specified thrown error type, it's 'any Error'.
0 commit comments