File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -827,6 +827,8 @@ bool swift::isRepresentableInLanguage(
827827 Reason.describe (AFD);
828828 return true ;
829829 };
830+ if (AFD->hasThrows () && isTypedThrow ())
831+ return false ;
830832
831833 if (AFD->hasAsync ()) {
832834 // Asynchronous functions move all of the result value and thrown error
@@ -906,8 +908,6 @@ bool swift::isRepresentableInLanguage(
906908 // a thrown error.
907909 std::optional<unsigned > completionHandlerErrorParamIndex;
908910 if (FD->hasThrows ()) {
909- if (isTypedThrow ())
910- return false ;
911911 completionHandlerErrorParamIndex = completionHandlerParams.size ();
912912 auto errorType = ctx.getErrorExistentialType ();
913913 addCompletionHandlerParam (OptionalType::get (errorType));
@@ -932,9 +932,6 @@ bool swift::isRepresentableInLanguage(
932932 SourceLoc throwsLoc;
933933 Type resultType;
934934
935- if (isTypedThrow ())
936- return false ;
937-
938935 const ConstructorDecl *ctor = nullptr ;
939936 if (auto func = dyn_cast<FuncDecl>(AFD)) {
940937 resultType = func->getResultInterfaceType ();
You can’t perform that action at this time.
0 commit comments