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}}
152
152
153
153
ifawaitbooleanFlag{
154
-
// This is not an actual use since we are passing values to the same
155
-
// isolation domain.
156
-
await a.useKlass(ns1)
157
-
// expected-complete-warning @-1 {{passing argument of non-sendable type 'NonSendableKlass'}}
154
+
await a.useKlass(ns1) // expected-tns-note {{access can happen concurrently}}
158
155
} else {
159
156
closure() // expected-tns-note {{access can happen concurrently}}
awaittransferToMain(test) // expected-tns-warning {{sending 'test' risks causing data races}}
1232
1229
// 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}}
1233
-
// expected-complete-warning @-2 {{passing argument of non-sendable type 'StructFieldTests' into main actor-isolated context may introduce data races}}
1230
+
// expected-tns-note @-2 {{access can happen concurrently}}
1234
1231
1235
1232
// This is treated as a use since test is in box form and is mutable. So we
1236
1233
// treat assignment as a merge.
1237
-
test =StructFieldTests() // 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}}
1754
-
awaittransferToMain(x) // expected-complete-warning {{passing argument of non-sendable type 'NonSendableKlass' into main actor-isolated context may introduce data races}}
1750
+
awaittransferToMain(x) // expected-tns-warning {{sending 'x' risks causing data races}}
1751
+
// 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}}
1752
+
awaittransferToMain(x) // expected-tns-note {{access can happen concurrently}}
// 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