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(
827
827
Reason.describe (AFD);
828
828
return true ;
829
829
};
830
+ if (AFD->hasThrows () && isTypedThrow ())
831
+ return false ;
830
832
831
833
if (AFD->hasAsync ()) {
832
834
// Asynchronous functions move all of the result value and thrown error
@@ -906,8 +908,6 @@ bool swift::isRepresentableInLanguage(
906
908
// a thrown error.
907
909
std::optional<unsigned > completionHandlerErrorParamIndex;
908
910
if (FD->hasThrows ()) {
909
- if (isTypedThrow ())
910
- return false ;
911
911
completionHandlerErrorParamIndex = completionHandlerParams.size ();
912
912
auto errorType = ctx.getErrorExistentialType ();
913
913
addCompletionHandlerParam (OptionalType::get (errorType));
@@ -932,9 +932,6 @@ bool swift::isRepresentableInLanguage(
932
932
SourceLoc throwsLoc;
933
933
Type resultType;
934
934
935
- if (isTypedThrow ())
936
- return false ;
937
-
938
935
const ConstructorDecl *ctor = nullptr ;
939
936
if (auto func = dyn_cast<FuncDecl>(AFD)) {
940
937
resultType = func->getResultInterfaceType ();
You can’t perform that action at this time.
0 commit comments