@@ -422,13 +422,10 @@ enum class BuiltinThrowsKind : uint8_t {
422
422
}
423
423
424
424
// / Build a builtin function declaration.
425
- static FuncDecl *
426
- getBuiltinGenericFunction (Identifier Id,
427
- ArrayRef<AnyFunctionType::Param> ArgParamTypes,
428
- Type ResType,
429
- GenericParamList *GenericParams,
430
- GenericSignature Sig,
431
- bool Async, BuiltinThrowsKind Throws) {
425
+ static FuncDecl *getBuiltinGenericFunction (
426
+ Identifier Id, ArrayRef<AnyFunctionType::Param> ArgParamTypes, Type ResType,
427
+ GenericParamList *GenericParams, GenericSignature Sig, bool Async,
428
+ BuiltinThrowsKind Throws, bool SendingResult) {
432
429
assert (GenericParams && " Missing generic parameters" );
433
430
auto &Context = ResType->getASTContext ();
434
431
@@ -460,6 +457,7 @@ getBuiltinGenericFunction(Identifier Id,
460
457
Throws != BuiltinThrowsKind::None, /* thrownType=*/ Type (),
461
458
GenericParams, paramList, ResType, DC);
462
459
460
+ func->setSendingResult (SendingResult);
463
461
func->setAccess (AccessLevel::Public);
464
462
func->setGenericSignature (Sig);
465
463
if (Throws == BuiltinThrowsKind::Rethrows)
@@ -681,6 +679,7 @@ namespace {
681
679
Type InterfaceResult;
682
680
bool Async = false ;
683
681
BuiltinThrowsKind Throws = BuiltinThrowsKind::None;
682
+ bool SendingResult = false ;
684
683
685
684
// Accumulate params and requirements here, so that we can call
686
685
// `buildGenericSignature()` when `build()` is called.
@@ -745,16 +744,17 @@ namespace {
745
744
Throws = BuiltinThrowsKind::Rethrows;
746
745
}
747
746
747
+ void setSendingResult () { SendingResult = true ; }
748
+
748
749
FuncDecl *build (Identifier name) {
749
750
auto GenericSig = buildGenericSignature (
750
751
Context, GenericSignature (),
751
752
std::move (genericParamTypes),
752
753
std::move (addedRequirements),
753
754
/* allowInverses=*/ false );
754
- return getBuiltinGenericFunction (name, InterfaceParams,
755
- InterfaceResult,
756
- TheGenericParamList, GenericSig,
757
- Async, Throws);
755
+ return getBuiltinGenericFunction (name, InterfaceParams, InterfaceResult,
756
+ TheGenericParamList, GenericSig, Async,
757
+ Throws, SendingResult);
758
758
}
759
759
760
760
// Don't use these generator classes directly; call the make{...}
@@ -2073,6 +2073,7 @@ static ValueDecl *getWithUnsafeContinuation(ASTContext &ctx,
2073
2073
builder.setAsync ();
2074
2074
if (throws)
2075
2075
builder.setThrows ();
2076
+ builder.setSendingResult ();
2076
2077
2077
2078
return builder.build (id);
2078
2079
}
0 commit comments