You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// FIXME: Region isolation should consider a value from a 'nonisolated(unsafe)'
32
32
// declaration to be in a disconnected region
33
33
34
-
// expected-region-isolation-warning @+3 {{transferring non-Sendable binding 'it' could yield races with later accesses}}
34
+
// expected-region-isolation-warning @+3 {{transferring non-Sendable value 'it' could yield races with later accesses}}
35
35
// expected-region-isolation-note @+2 {{'it' is transferred from main actor-isolated caller to nonisolated callee. Later uses in caller could race with potential uses in callee}}
36
36
// expected-region-isolation-note @+1 {{access here could race}}
lett=NonSendable() // expected-tns-note {{variable defined here}}
274
274
await t.update()
275
275
// expected-targeted-and-complete-warning @-1 {{passing argument of non-sendable type 'NonSendable' into main actor-isolated context may introduce data races}}
276
-
// expected-tns-warning @-2 {{transferring non-Sendable binding 't' could yield races with later accesses}}
276
+
// expected-tns-warning @-2 {{transferring non-Sendable value 't' could yield races with later accesses}}
277
277
// expected-tns-note @-3 {{'t' is transferred from nonisolated caller to main actor-isolated callee. Later uses in caller could race with potential uses in callee}}
// expected-complete-warning @-1 {{passing argument of non-sendable type 'NonSendableKlass'}}
126
-
// expected-tns-warning @-2 {{transferring non-Sendable binding 'ns0' could yield races with later accesses}}
126
+
// expected-tns-warning @-2 {{transferring non-Sendable value 'ns0' could yield races with later accesses}}
127
127
// expected-tns-note @-3 {{'ns0' is transferred from nonisolated caller to actor-isolated callee. Later uses in caller could race with potential uses in callee}}
128
128
129
129
// We only emit a warning on the first use we see, so make sure we do both
await a.useKlass(ns0) // expected-tns-warning {{transferring non-Sendable binding 'ns0' could yield races with later accesses}}
149
+
await a.useKlass(ns0) // expected-tns-warning {{transferring non-Sendable value 'ns0' could yield races with later accesses}}
150
150
// expected-tns-note @-1 {{'ns0' is transferred from nonisolated caller to actor-isolated callee. Later uses in caller could race with potential uses in callee}}
151
151
// expected-complete-warning @-2 {{passing argument of non-sendable type 'NonSendableKlass'}}
152
152
153
153
closure ={useInOut(&contents)} // expected-tns-note {{access here could race}}
154
154
155
-
await a.useKlass(ns1) // expected-tns-warning {{transferring non-Sendable binding 'ns1' could yield races with later accesses}}
155
+
await a.useKlass(ns1) // expected-tns-warning {{transferring non-Sendable value 'ns1' could yield races with later accesses}}
156
156
// expected-tns-note @-1 {{'ns1' is transferred from nonisolated caller to actor-isolated callee. Later uses in caller could race with potential uses in callee}}
157
157
// expected-complete-warning @-2 {{passing argument of non-sendable type 'NonSendableKlass'}}
await a.useKlass(ns1) // expected-tns-warning {{transferring non-Sendable binding 'ns1' could yield races with later accesses}}
177
+
await a.useKlass(ns1) // expected-tns-warning {{transferring non-Sendable value 'ns1' could yield races with later accesses}}
178
178
// expected-tns-note @-1 {{'ns1' is transferred from nonisolated caller to actor-isolated callee. Later uses in caller could race with potential uses in callee}}
179
179
// expected-complete-warning @-2 {{passing argument of non-sendable type 'NonSendableKlass'}}
Copy file name to clipboardExpand all lines: test/Concurrency/transfernonsendable_region_based_sendability.swift
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -353,7 +353,7 @@ func test_indirect_regions(a : A, b : Bool) async {
353
353
}
354
354
355
355
if(b){
356
-
await a.foo(ns5_0) // expected-tns-warning {{transferring non-Sendable binding 'ns5_0' could yield races with later accesses}}
356
+
await a.foo(ns5_0) // expected-tns-warning {{transferring non-Sendable value 'ns5_0' could yield races with later accesses}}
357
357
// expected-tns-note @-1 {{'ns5_0' is transferred from nonisolated caller to actor-isolated callee. Later uses in caller could race with potential uses in callee}}
358
358
// expected-complete-warning @-2 {{passing argument of non-sendable type 'Any' into actor-isolated context may introduce data races}}
359
359
@@ -363,7 +363,7 @@ func test_indirect_regions(a : A, b : Bool) async {
363
363
print(ns5_1) // expected-tns-note {{access here could race}}
364
364
}
365
365
}else{
366
-
await a.foo(ns5_1) // expected-tns-warning {{transferring non-Sendable binding 'ns5_1' could yield races with later accesses}}
366
+
await a.foo(ns5_1) // expected-tns-warning {{transferring non-Sendable value 'ns5_1' could yield races with later accesses}}
367
367
// expected-tns-note @-1 {{'ns5_1' is transferred from nonisolated caller to actor-isolated callee. Later uses in caller could race with potential uses in callee}}
368
368
// expected-complete-warning @-2 {{passing argument of non-sendable type 'Any' into actor-isolated context may introduce data races}}
// TODO: This should refer to the transferring parameter.
217
-
awaittransferToMain(x) // expected-warning {{transferring non-Sendable binding 'x' could yield races with later accesses}}
217
+
awaittransferToMain(x) // expected-warning {{transferring non-Sendable value 'x' could yield races with later accesses}}
218
218
// expected-note @-1 {{'x' is transferred from nonisolated caller to main actor-isolated callee. Later uses in caller could race with potential uses in callee}}
219
219
220
220
useValue(x) // expected-note {{access here could race}}
0 commit comments