@@ -9,7 +9,9 @@ public class NonSendableKlass {}
9
9
// CHECK-LABEL: #if compiler(>=5.3) && $SendingArgsAndResults
10
10
// CHECK-NEXT: public func transferArgTest(_ x: sending test.NonSendableKlass)
11
11
// CHECK-NEXT: #else
12
- // CHECK-NEXT: public func transferArgTest(_ x: test.NonSendableKlass)
12
+ // When we suppress, we preserve +1 by marking the parameter as __owned. Otherwise, we
13
+ // be breaking ABI.
14
+ // CHECK-NEXT: public func transferArgTest(_ x: __owned test.NonSendableKlass)
13
15
// CHECK-NEXT: #endif
14
16
public func transferArgTest( _ x: sending NonSendableKlass) { }
15
17
@@ -23,14 +25,14 @@ public func transferResultTest() -> sending NonSendableKlass { fatalError() }
23
25
// CHECK-LABEL: #if compiler(>=5.3) && $SendingArgsAndResults
24
26
// CHECK-NEXT: public func transferArgAndResultTest(_ x: test.NonSendableKlass, _ y: sending test.NonSendableKlass, _ z: test.NonSendableKlass) -> sending test.NonSendableKlass
25
27
// CHECK-NEXT: #else
26
- // CHECK-NEXT: public func transferArgAndResultTest(_ x: test.NonSendableKlass, _ y: test.NonSendableKlass, _ z: test.NonSendableKlass) -> test.NonSendableKlass
28
+ // CHECK-NEXT: public func transferArgAndResultTest(_ x: test.NonSendableKlass, _ y: __owned test.NonSendableKlass, _ z: test.NonSendableKlass) -> test.NonSendableKlass
27
29
// CHECK-NEXT: #endif
28
30
public func transferArgAndResultTest( _ x: NonSendableKlass , _ y: sending NonSendableKlass, _ z: NonSendableKlass ) -> sending NonSendableKlass { fatalError ( ) }
29
31
30
32
// CHECK-LABEL: #if compiler(>=5.3) && $SendingArgsAndResults
31
33
// CHECK-NEXT: public func argEmbeddedInType(_ fn: (sending test.NonSendableKlass) -> ())
32
34
// CHECK-NEXT: #else
33
- // CHECK-NEXT: public func argEmbeddedInType(_ fn: (test.NonSendableKlass) -> ())
35
+ // CHECK-NEXT: public func argEmbeddedInType(_ fn: (__owned test.NonSendableKlass) -> ())
34
36
// CHECK-NEXT: #endif
35
37
public func argEmbeddedInType( _ fn: ( sending NonSendableKlass) -> ( ) ) { }
36
38
@@ -44,15 +46,15 @@ public func resultEmbeddedInType(_ fn: () -> sending NonSendableKlass) {}
44
46
// CHECK-LABEL: #if compiler(>=5.3) && $SendingArgsAndResults
45
47
// CHECK-NEXT: public func argAndResultEmbeddedInType(_ fn: (test.NonSendableKlass, sending test.NonSendableKlass, test.NonSendableKlass) -> sending test.NonSendableKlass)
46
48
// CHECK-NEXT: #else
47
- // CHECK-NEXT: public func argAndResultEmbeddedInType(_ fn: (test.NonSendableKlass, test.NonSendableKlass, test.NonSendableKlass) -> test.NonSendableKlass)
49
+ // CHECK-NEXT: public func argAndResultEmbeddedInType(_ fn: (test.NonSendableKlass, __owned test.NonSendableKlass, test.NonSendableKlass) -> test.NonSendableKlass)
48
50
// CHECK-NEXT: #endif
49
51
public func argAndResultEmbeddedInType( _ fn: ( NonSendableKlass , sending NonSendableKlass, NonSendableKlass ) -> sending NonSendableKlass) { }
50
52
51
53
public class TestInKlass {
52
54
// CHECK-LABEL: #if compiler(>=5.3) && $SendingArgsAndResults
53
55
// CHECK-NEXT: public func testKlassArg(_ x: sending test.NonSendableKlass)
54
56
// CHECK-NEXT: #else
55
- // CHECK-NEXT: public func testKlassArg(_ x: test.NonSendableKlass)
57
+ // CHECK-NEXT: public func testKlassArg(_ x: __owned test.NonSendableKlass)
56
58
// CHECK-NEXT: #endif
57
59
public func testKlassArg( _ x: sending NonSendableKlass) { fatalError ( ) }
58
60
@@ -66,7 +68,7 @@ public class TestInKlass {
66
68
// CHECK-LABEL: #if compiler(>=5.3) && $SendingArgsAndResults
67
69
// CHECK-NEXT: public func testKlassArgAndResult(_ x: test.NonSendableKlass, _ y: sending test.NonSendableKlass, z: test.NonSendableKlass) -> sending test.NonSendableKlass
68
70
// CHECK-NEXT: #else
69
- // CHECK-NEXT: public func testKlassArgAndResult(_ x: test.NonSendableKlass, _ y: test.NonSendableKlass, z: test.NonSendableKlass) -> test.NonSendableKlass
71
+ // CHECK-NEXT: public func testKlassArgAndResult(_ x: test.NonSendableKlass, _ y: __owned test.NonSendableKlass, z: test.NonSendableKlass) -> test.NonSendableKlass
70
72
// CHECK-NEXT: #endif
71
73
public func testKlassArgAndResult( _ x: NonSendableKlass , _ y: sending NonSendableKlass, z: NonSendableKlass ) -> sending NonSendableKlass { fatalError ( ) }
72
74
}
@@ -75,7 +77,7 @@ public struct TestInStruct {
75
77
// CHECK-LABEL: #if compiler(>=5.3) && $SendingArgsAndResults
76
78
// CHECK-NEXT: public func testKlassArg(_ x: sending test.NonSendableKlass)
77
79
// CHECK-NEXT: #else
78
- // CHECK-NEXT: public func testKlassArg(_ x: test.NonSendableKlass)
80
+ // CHECK-NEXT: public func testKlassArg(_ x: __owned test.NonSendableKlass)
79
81
// CHECK-NEXT: #endif
80
82
public func testKlassArg( _ x: sending NonSendableKlass) { fatalError ( ) }
81
83
@@ -89,7 +91,7 @@ public struct TestInStruct {
89
91
// CHECK-LABEL: #if compiler(>=5.3) && $SendingArgsAndResults
90
92
// CHECK-NEXT: public func testKlassArgAndResult(_ x: test.NonSendableKlass, _ y: sending test.NonSendableKlass, z: test.NonSendableKlass) -> sending test.NonSendableKlass
91
93
// CHECK-NEXT: #else
92
- // CHECK-NEXT: public func testKlassArgAndResult(_ x: test.NonSendableKlass, _ y: test.NonSendableKlass, z: test.NonSendableKlass) -> test.NonSendableKlass
94
+ // CHECK-NEXT: public func testKlassArgAndResult(_ x: test.NonSendableKlass, _ y: __owned test.NonSendableKlass, z: test.NonSendableKlass) -> test.NonSendableKlass
93
95
// CHECK-NEXT: #endif
94
96
public func testKlassArgAndResult( _ x: NonSendableKlass , _ y: sending NonSendableKlass, z: NonSendableKlass ) -> sending NonSendableKlass { fatalError ( ) }
95
97
@@ -112,7 +114,7 @@ public struct TestInStruct {
112
114
// CHECK-NEXT: internal func testUsableFromInlineKlassArg(_ x: sending test.NonSendableKlass)
113
115
// CHECK-NEXT: #else
114
116
// CHECK-NEXT: @usableFromInline
115
- // CHECK-NEXT: internal func testUsableFromInlineKlassArg(_ x: test.NonSendableKlass)
117
+ // CHECK-NEXT: internal func testUsableFromInlineKlassArg(_ x: __owned test.NonSendableKlass)
116
118
// CHECK-NEXT: #endif
117
119
@usableFromInline func testUsableFromInlineKlassArg( _ x: sending NonSendableKlass) { fatalError ( ) }
118
120
@@ -131,7 +133,7 @@ public struct TestInStruct {
131
133
// CHECK-NEXT: internal func testUsableFromInlineKlassArgAndResult(_ x: test.NonSendableKlass, _ y: sending test.NonSendableKlass, z: test.NonSendableKlass) -> sending test.NonSendableKlass
132
134
// CHECK-NEXT: #else
133
135
// CHECK-NEXT: @usableFromInline
134
- // CHECK-NEXT: internal func testUsableFromInlineKlassArgAndResult(_ x: test.NonSendableKlass, _ y: test.NonSendableKlass, z: test.NonSendableKlass) -> test.NonSendableKlass
136
+ // CHECK-NEXT: internal func testUsableFromInlineKlassArgAndResult(_ x: test.NonSendableKlass, _ y: __owned test.NonSendableKlass, z: test.NonSendableKlass) -> test.NonSendableKlass
135
137
// CHECK-NEXT: #endif
136
138
@usableFromInline
137
139
func testUsableFromInlineKlassArgAndResult( _ x: NonSendableKlass , _ y: sending NonSendableKlass, z: NonSendableKlass ) -> sending NonSendableKlass { fatalError ( ) }
@@ -159,7 +161,7 @@ public struct TestInStruct {
159
161
// CHECK-LABEL: #if compiler(>=5.3) && $SendingArgsAndResults
160
162
// CHECK-NEXT: public var publicVarFieldFunctionArg: (sending test.NonSendableKlass) -> ()
161
163
// CHECK-NEXT: #else
162
- // CHECK-NEXT: public var publicVarFieldFunctionArg: (test.NonSendableKlass) -> ()
164
+ // CHECK-NEXT: public var publicVarFieldFunctionArg: (__owned test.NonSendableKlass) -> ()
163
165
// CHECK-NEXT: #endif
164
166
public var publicVarFieldFunctionArg : ( sending NonSendableKlass) -> ( )
165
167
@@ -168,15 +170,15 @@ public struct TestInStruct {
168
170
// CHECK-NEXT: internal var internalVarFieldFunctionArg: (sending test.NonSendableKlass) -> ()
169
171
// CHECK-NEXT: #else
170
172
// CHECK-NEXT: @usableFromInline
171
- // CHECK-NEXT: internal var internalVarFieldFunctionArg: (test.NonSendableKlass) -> ()
173
+ // CHECK-NEXT: internal var internalVarFieldFunctionArg: (__owned test.NonSendableKlass) -> ()
172
174
// CHECK-NEXT: #endif
173
175
@usableFromInline
174
176
var internalVarFieldFunctionArg : ( sending NonSendableKlass) -> ( )
175
177
176
178
// CHECK-LABEL: #if compiler(>=5.3) && $SendingArgsAndResults
177
179
// CHECK-NEXT: public let publicLetFieldFunctionArg: (sending test.NonSendableKlass) -> ()
178
180
// CHECK-NEXT: #else
179
- // CHECK-NEXT: public let publicLetFieldFunctionArg: (test.NonSendableKlass) -> ()
181
+ // CHECK-NEXT: public let publicLetFieldFunctionArg: (__owned test.NonSendableKlass) -> ()
180
182
// CHECK-NEXT: #endif
181
183
public let publicLetFieldFunctionArg : ( sending NonSendableKlass) -> ( )
182
184
@@ -185,7 +187,7 @@ public struct TestInStruct {
185
187
// CHECK-NEXT: internal let internalLetFieldFunctionArg: (sending test.NonSendableKlass) -> ()
186
188
// CHECK-NEXT: #else
187
189
// CHECK-NEXT: @usableFromInline
188
- // CHECK-NEXT: internal let internalLetFieldFunctionArg: (test.NonSendableKlass) -> ()
190
+ // CHECK-NEXT: internal let internalLetFieldFunctionArg: (__owned test.NonSendableKlass) -> ()
189
191
// CHECK-NEXT: #endif
190
192
@usableFromInline
191
193
let internalLetFieldFunctionArg : ( sending NonSendableKlass) -> ( )
@@ -226,7 +228,7 @@ public struct TestInStruct {
226
228
// CHECK-LABEL: #if compiler(>=5.3) && $SendingArgsAndResults // Suppression Count: 26
227
229
// CHECK-NEXT: public var publicGlobal: (sending test.NonSendableKlass) -> ()
228
230
// CHECK-NEXT: #else
229
- // CHECK-NEXT: public var publicGlobal: (test.NonSendableKlass) -> ()
231
+ // CHECK-NEXT: public var publicGlobal: (__owned test.NonSendableKlass) -> ()
230
232
// CHECK-NEXT: #endif
231
233
public var publicGlobal : ( sending NonSendableKlass) -> ( ) = { x in fatalError ( ) }
232
234
@@ -235,7 +237,7 @@ public var publicGlobal: (sending NonSendableKlass) -> () = { x in fatalError()
235
237
// CHECK-NEXT: internal var usableFromInlineGlobal: (sending test.NonSendableKlass) -> ()
236
238
// CHECK-NEXT: #else
237
239
// CHECK-NEXT: @usableFromInline
238
- // CHECK-NEXT: internal var usableFromInlineGlobal: (test.NonSendableKlass) -> ()
240
+ // CHECK-NEXT: internal var usableFromInlineGlobal: (__owned test.NonSendableKlass) -> ()
239
241
// CHECK-NEXT: #endif
240
242
@usableFromInline
241
243
internal var usableFromInlineGlobal : ( sending NonSendableKlass) -> ( ) = { x in fatalError ( ) }
0 commit comments