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
// expected-warning@+2 {{expression is 'async' but is not marked with 'await'}}
142
142
// expected-note@+1 {{property access is 'async'}}
143
143
leta= globalValue // expected-warning{{non-sendable type 'NotConcurrent?' in implicitly asynchronous access to global actor 'SomeGlobalActor'-isolated let 'globalValue' cannot cross actor boundary}}
144
-
awaitglobalAsync(a)
145
-
awaitglobalSync(a)
144
+
awaitglobalAsync(a) // expected-tns-warning {{sending 'a' risks causing data races}}
145
+
// expected-tns-note @-1 {{sending global actor 'SomeGlobalActor'-isolated 'a' to global actor 'SomeGlobalActor'-isolated global function 'globalAsync' risks causing data races between global actor 'SomeGlobalActor'-isolated and local nonisolated uses}}
146
+
awaitglobalSync(a) // expected-tns-note {{access can happen concurrently}}
146
147
147
148
// expected-warning@+2 {{expression is 'async' but is not marked with 'await'}}
148
149
// expected-note@+1 {{property access is 'async'}}
// expected-warning@+2 {{expression is 'async' but is not marked with 'await'}}
178
179
// expected-note@+1 {{property access is 'async'}}
179
180
leta= globalValue // expected-warning {{non-sendable type 'NotConcurrent?' in implicitly asynchronous access to global actor 'SomeGlobalActor'-isolated let 'globalValue' cannot cross actor boundary}}
180
-
awaitglobalAsync(a)
181
-
awaitglobalSync(a)
181
+
awaitglobalAsync(a) // expected-tns-warning {{sending 'a' risks causing data races}}
182
+
// expected-tns-note @-1 {{sending global actor 'SomeGlobalActor'-isolated 'a' to global actor 'SomeGlobalActor'-isolated global function 'globalAsync' risks causing data races between global actor 'SomeGlobalActor'-isolated and local main actor-isolated uses}}
183
+
awaitglobalSync(a) // expected-tns-note {{access can happen concurrently}}
182
184
_ =awaitClassWithGlobalActorInits(nc)
183
185
// expected-warning @-1 {{non-sendable type 'ClassWithGlobalActorInits' returned by call to global actor 'SomeGlobalActor'-isolated function cannot cross actor boundary}}
184
186
// expected-tns-warning @-2 {{sending 'nc' risks causing data races}}
// expected-targeted-and-complete-warning @-1 {{passing argument of non-sendable type 'NonSendable' into main actor-isolated context may introduce data races}}
298
+
// expected-tns-warning @-2 {{sending 't' risks causing data races}}
299
+
// expected-tns-note @-3 {{sending 't' to main actor-isolated instance method 'update()' risks causing data races between main actor-isolated and local nonisolated uses}}
298
300
299
301
_ =await t.x
300
302
// expected-warning @-1 {{non-sendable type 'NonSendable' passed in implicitly asynchronous call to main actor-isolated property 'x' cannot cross actor boundary}}
303
+
// expected-tns-note @-2 {{access can happen concurrently}}
301
304
}
302
305
303
306
// We get the region isolation error here since t.y is custom actor isolated.
// expected-tns-note @-3 {{sending 'ns0' to actor-isolated instance method 'useKlass' risks causing data races between actor-isolated and local nonisolated uses}}
146
146
147
147
ifawaitbooleanFlag{
148
-
// This is not an actual use since we are passing values to the same
149
-
// isolation domain.
150
-
await a.useKlass(ns1)
151
-
// expected-complete-warning @-1 {{passing argument of non-sendable type 'NonSendableKlass'}}
148
+
await a.useKlass(ns1) // expected-tns-note {{access can happen concurrently}}
152
149
} else {
153
150
closure() // expected-tns-note {{access can happen concurrently}}
awaittransferToMain(test) // expected-tns-warning {{sending 'test' risks causing data races}}
1226
1223
// expected-tns-note @-1 {{sending 'test' to main actor-isolated global function 'transferToMain' risks causing data races between main actor-isolated and local nonisolated uses}}
1227
-
// expected-complete-warning @-2 {{passing argument of non-sendable type 'StructFieldTests' into main actor-isolated context may introduce data races}}
1224
+
// expected-tns-note @-2 {{access can happen concurrently}}
1228
1225
1229
1226
// This is treated as a use since test is in box form and is mutable. So we
1230
1227
// treat assignment as a merge.
1231
-
test =StructFieldTests() // expected-tns-note {{access can happen concurrently}}
awaittransferToMain(x) // expected-tns-warning {{sending 'x' risks causing data races}}
1745
+
// expected-tns-note @-1 {{sending 'x' to main actor-isolated global function 'transferToMain' risks causing data races between main actor-isolated and local nonisolated uses}}
1746
+
awaittransferToMain(x) // expected-tns-note {{access can happen concurrently}}
awaittransferToMain(x) // expected-complete-warning {{passing argument of non-sendable type 'NonSendableKlass' into main actor-isolated context may introduce data races}}
1836
-
awaittransferToMain(x) // expected-complete-warning {{passing argument of non-sendable type 'NonSendableKlass' into main actor-isolated context may introduce data races}}
// expected-warning @-1:26 {{sending 'x' risks causing data races}}
301
+
// expected-note @-2:26 {{sending 'x' to main actor-isolated global function 'transferToMainInt' risks causing data races between main actor-isolated and local nonisolated uses}}
302
+
// expected-note @-3:49 {{access can happen concurrently}}
0 commit comments