File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -673,7 +673,7 @@ static bool usesFeatureSendingArgsAndResults(Decl *decl) {
673673 return true ;
674674 }
675675
676- if (auto *fDecl = dyn_cast<FuncDecl >(decl)) {
676+ if (auto *fDecl = dyn_cast<AbstractFunctionDecl >(decl)) {
677677 // First check for param decl results.
678678 if (llvm::any_of (fDecl ->getParameters ()->getArray (), [](ParamDecl *pd) {
679679 return usesFeatureSendingArgsAndResults (pd);
Original file line number Diff line number Diff line change @@ -95,14 +95,14 @@ public struct TestInStruct {
9595 // CHECK-NEXT: public func testFunctionArg(_ x: () -> sending test.NonSendableKlass)
9696 // CHECK-NEXT: #else
9797 // CHECK-NEXT: public func testFunctionArg(_ x: () -> test.NonSendableKlass)
98- // CHECK-NEXT: #endif
98+ // CHECK-NEXT: #endif
9999 public func testFunctionArg( _ x: ( ) -> sending NonSendableKlass) { fatalError ( ) }
100100
101101 // CHECK-LABEL: #if compiler(>=5.3) && $SendingArgsAndResults
102102 // CHECK-NEXT: public func testFunctionResult() -> (() -> sending test.NonSendableKlass)
103103 // CHECK-NEXT: #else
104104 // CHECK-NEXT: public func testFunctionResult() -> (() -> test.NonSendableKlass)
105- // CHECK-NEXT: #endif
105+ // CHECK-NEXT: #endif
106106 public func testFunctionResult( ) -> ( ( ) -> sending NonSendableKlass) { fatalError ( ) }
107107
108108 // CHECK-LABEL: #if compiler(>=5.3) && $SendingArgsAndResults
@@ -187,6 +187,16 @@ public struct TestInStruct {
187187 // CHECK-NEXT: #endif
188188 @usableFromInline
189189 let internalLetFieldFunctionArg : ( sending NonSendableKlass) -> ( )
190+
191+ // CHECK-LABEL: #if compiler(>=5.3) && $SendingArgsAndResults
192+ // CHECK-NEXT: @usableFromInline
193+ // CHECK-NEXT: internal init(_ x: Int, transformWithResult: @escaping () async throws -> sending test.NonSendableKlass) { fatalError() }
194+ // CHECK-NEXT: #else
195+ // CHECK-NEXT: @usableFromInline
196+ // CHECK-NEXT: internal init(_ x: Int, transformWithResult: @escaping () async throws -> test.NonSendableKlass) { fatalError() }
197+ // CHECK-NEXT: #endif
198+ @usableFromInline
199+ internal init ( _ x: Int , transformWithResult: @escaping ( ) async throws -> sending NonSendableKlass) { fatalError ( ) }
190200}
191201
192202// Make sure that we emit compiler(>= 5.3) when emitting the suppressing check
You can’t perform that action at this time.
0 commit comments