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 @@ -669,7 +669,7 @@ static bool usesFeatureSendingArgsAndResults(Decl *decl) {
669
669
return true ;
670
670
}
671
671
672
- if (auto *fDecl = dyn_cast<FuncDecl >(decl)) {
672
+ if (auto *fDecl = dyn_cast<AbstractFunctionDecl >(decl)) {
673
673
// First check for param decl results.
674
674
if (llvm::any_of (fDecl ->getParameters ()->getArray (), [](ParamDecl *pd) {
675
675
return usesFeatureSendingArgsAndResults (pd);
Original file line number Diff line number Diff line change @@ -95,14 +95,14 @@ public struct TestInStruct {
95
95
// CHECK-NEXT: public func testFunctionArg(_ x: () -> sending test.NonSendableKlass)
96
96
// CHECK-NEXT: #else
97
97
// CHECK-NEXT: public func testFunctionArg(_ x: () -> test.NonSendableKlass)
98
- // CHECK-NEXT: #endif
98
+ // CHECK-NEXT: #endif
99
99
public func testFunctionArg( _ x: ( ) -> sending NonSendableKlass) { fatalError ( ) }
100
100
101
101
// CHECK-LABEL: #if compiler(>=5.3) && $SendingArgsAndResults
102
102
// CHECK-NEXT: public func testFunctionResult() -> (() -> sending test.NonSendableKlass)
103
103
// CHECK-NEXT: #else
104
104
// CHECK-NEXT: public func testFunctionResult() -> (() -> test.NonSendableKlass)
105
- // CHECK-NEXT: #endif
105
+ // CHECK-NEXT: #endif
106
106
public func testFunctionResult( ) -> ( ( ) -> sending NonSendableKlass) { fatalError ( ) }
107
107
108
108
// CHECK-LABEL: #if compiler(>=5.3) && $SendingArgsAndResults
@@ -187,6 +187,16 @@ public struct TestInStruct {
187
187
// CHECK-NEXT: #endif
188
188
@usableFromInline
189
189
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 ( ) }
190
200
}
191
201
192
202
// 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