@@ -3715,11 +3715,6 @@ NeverNullType TypeResolver::resolveASTFunctionType(
37153715 Type thrownTy;
37163716 if (auto thrownTypeRepr = repr->getThrownTypeRepr ()) {
37173717 ASTContext &ctx = getASTContext ();
3718- if (!ctx.LangOpts .hasFeature (Feature::TypedThrows)) {
3719- diagnoseInvalid (
3720- thrownTypeRepr, thrownTypeRepr->getLoc (), diag::experimental_typed_throws);
3721- }
3722-
37233718 auto thrownTypeOptions = options.withoutContext ();
37243719 thrownTy = resolveType (thrownTypeRepr, thrownTypeOptions);
37253720 if (thrownTy->hasError ()) {
@@ -5691,10 +5686,6 @@ Type ExplicitCaughtTypeRequest::evaluate(
56915686 }
56925687
56935688 // We have an explicit thrown error type, so resolve it.
5694- if (!ctx.LangOpts .hasFeature (Feature::TypedThrows)) {
5695- ctx.Diags .diagnose (thrownTypeRepr->getLoc (), diag::experimental_typed_throws);
5696- }
5697-
56985689 auto options = TypeResolutionOptions (TypeResolverContext::None);
56995690 if (func->preconcurrency ())
57005691 options |= TypeResolutionFlags::Preconcurrency;
@@ -5710,11 +5701,6 @@ Type ExplicitCaughtTypeRequest::evaluate(
57105701 if (auto closure = catchNode.dyn_cast <ClosureExpr *>()) {
57115702 // Explicit thrown error type.
57125703 if (auto thrownTypeRepr = closure->getExplicitThrownTypeRepr ()) {
5713- if (!ctx.LangOpts .hasFeature (Feature::TypedThrows)) {
5714- ctx.Diags .diagnose (thrownTypeRepr->getLoc (),
5715- diag::experimental_typed_throws);
5716- }
5717-
57185704 return TypeResolution::resolveContextualType (
57195705 thrownTypeRepr, closure,
57205706 TypeResolutionOptions (TypeResolverContext::None),
@@ -5736,18 +5722,9 @@ Type ExplicitCaughtTypeRequest::evaluate(
57365722 // A do..catch block with no explicit 'throws' annotation will infer
57375723 // the thrown error type.
57385724 if (doCatch->getThrowsLoc ().isInvalid ()) {
5739- // Prior to typed throws, the do..catch always throws 'any Error'.
5740- if (!ctx.LangOpts .hasFeature (Feature::TypedThrows))
5741- return ctx.getErrorExistentialType ();
5742-
57435725 return Type ();
57445726 }
57455727
5746- if (!ctx.LangOpts .hasFeature (Feature::TypedThrows)) {
5747- ctx.Diags .diagnose (doCatch->getThrowsLoc (), diag::experimental_typed_throws);
5748- return ctx.getErrorExistentialType ();
5749- }
5750-
57515728 auto typeRepr = doCatch->getCaughtTypeRepr ();
57525729
57535730 // If there is no explicitly-specified thrown error type, it's 'any Error'.
0 commit comments