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
_ =A2(value: value) // expected-complete-warning{{passing argument of non-sendable type 'NotConcurrent' into actor-isolated context may introduce data races}}
69
+
_ =A2(value: value)
71
70
// expected-tns-warning @-1 {{sending 'value' risks causing data races}}
72
71
// expected-tns-note @-2 {{sending task-isolated 'value' to actor-isolated initializer 'init(value:)' risks causing data races between actor-isolated and task-isolated uses}}
73
72
74
-
_ =awaitA2(valueAsync: value) // expected-complete-warning{{passing argument of non-sendable type 'NotConcurrent' into actor-isolated context may introduce data races}}
73
+
_ =awaitA2(valueAsync: value)
75
74
// expected-tns-warning @-1 {{sending 'value' risks causing data races}}
76
75
// expected-tns-note @-2 {{sending task-isolated 'value' to actor-isolated initializer 'init(valueAsync:)' risks causing data races between actor-isolated and task-isolated uses}}
77
76
78
-
_ =A2(delegatingSync: value) // expected-complete-warning{{passing argument of non-sendable type 'NotConcurrent' into actor-isolated context may introduce data races}}
77
+
_ =A2(delegatingSync: value)
79
78
// expected-tns-warning @-1 {{sending 'value' risks causing data races}}
80
79
// expected-tns-note @-2 {{sending task-isolated 'value' to actor-isolated initializer 'init(delegatingSync:)' risks causing data races between actor-isolated and task-isolated uses}}
81
80
82
-
_ =awaitA2(delegatingAsync: value,9) // expected-complete-warning{{passing argument of non-sendable type 'NotConcurrent' into actor-isolated context may introduce data races}}
81
+
_ =awaitA2(delegatingAsync: value,9)
83
82
// expected-tns-warning @-1 {{sending 'value' risks causing data races}}
84
83
// expected-tns-note @-2 {{sending task-isolated 'value' to actor-isolated initializer 'init(delegatingAsync:_:)' risks causing data races between actor-isolated and task-isolated uses}}
85
84
86
-
_ =awaitA2(nonisoAsync: value,3) // expected-complete-warning{{passing argument of non-sendable type 'NotConcurrent' into actor-isolated context may introduce data races}}
85
+
_ =awaitA2(nonisoAsync: value,3)
87
86
// expected-tns-warning @-1 {{sending 'value' risks causing data races}}
88
87
// expected-tns-note @-2 {{sending task-isolated 'value' to actor-isolated initializer 'init(nonisoAsync:_:)' risks causing data races between actor-isolated and task-isolated uses}}
89
88
}
@@ -104,7 +103,7 @@ extension A1 {
104
103
// expected-warning@-1 {{expression is 'async' but is not marked with 'await'}}
105
104
// expected-note@-2 {{property access is 'async'}}
106
105
_ =await other.synchronous() // expected-warning{{non-sendable type 'NotConcurrent?' returned by call to actor-isolated function cannot cross actor boundary}}
107
-
_ =await other.asynchronous(nil) // expected-complete-warning{{passing argument of non-sendable type 'NotConcurrent?' into actor-isolated context may introduce data races}}
106
+
_ =await other.asynchronous(nil)
108
107
}
109
108
}
110
109
@@ -142,8 +141,9 @@ func globalTest() async {
142
141
// expected-warning@+2 {{expression is 'async' but is not marked with 'await'}}
143
142
// expected-note@+1 {{property access is 'async'}}
144
143
leta= globalValue // expected-warning{{non-sendable type 'NotConcurrent?' in implicitly asynchronous access to global actor 'SomeGlobalActor'-isolated let 'globalValue' cannot cross actor boundary}}
145
-
awaitglobalAsync(a) // expected-complete-warning{{passing argument of non-sendable type 'NotConcurrent?' into global actor 'SomeGlobalActor'-isolated context may introduce data races}}
146
-
awaitglobalSync(a) // expected-complete-warning{{passing argument of non-sendable type 'NotConcurrent?' into global actor 'SomeGlobalActor'-isolated context may introduce data races}}
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}}
147
147
148
148
// expected-warning@+2 {{expression is 'async' but is not marked with 'await'}}
149
149
// expected-note@+1 {{property access is 'async'}}
@@ -154,7 +154,7 @@ func globalTest() async {
154
154
// expected-typechecker-note@+2 {{call is 'async'}}
155
155
// expected-typechecker-note@+1 {{property access is 'async'}}
156
156
globalAsync(E.notSafe)
157
-
// expected-complete-warning@-1 {{passing argument of non-sendable type 'NotConcurrent?' into global actor 'SomeGlobalActor'-isolated context may introduce data races}}
157
+
158
158
// expected-typechecker-warning@-2 {{non-sendable type 'NotConcurrent?' in implicitly asynchronous access to global actor 'SomeGlobalActor'-isolated static property 'notSafe' cannot cross actor boundary}}
// expected-warning@+2 {{expression is 'async' but is not marked with 'await'}}
179
179
// expected-note@+1 {{property access is 'async'}}
180
180
leta= globalValue // expected-warning {{non-sendable type 'NotConcurrent?' in implicitly asynchronous access to global actor 'SomeGlobalActor'-isolated let 'globalValue' cannot cross actor boundary}}
181
-
awaitglobalAsync(a) // expected-complete-warning {{passing argument of non-sendable type 'NotConcurrent?' into global actor 'SomeGlobalActor'-isolated context may introduce data races}}
182
-
awaitglobalSync(a) // expected-complete-warning {{passing argument of non-sendable type 'NotConcurrent?' into global actor 'SomeGlobalActor'-isolated context may introduce data races}}
183
-
_ =awaitClassWithGlobalActorInits(nc) // expected-complete-warning {{passing argument of non-sendable type 'NotConcurrent' into global actor 'SomeGlobalActor'-isolated context may introduce data races}}
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}}
184
+
_ =awaitClassWithGlobalActorInits(nc)
184
185
// expected-warning @-1 {{non-sendable type 'ClassWithGlobalActorInits' returned by call to global actor 'SomeGlobalActor'-isolated function cannot cross actor boundary}}
185
186
// expected-tns-warning @-2 {{sending 'nc' risks causing data races}}
186
187
// expected-tns-note @-3 {{sending main actor-isolated 'nc' to global actor 'SomeGlobalActor'-isolated initializer 'init(_:)' risks causing data races between global actor 'SomeGlobalActor'-isolated and main actor-isolated uses}}
// 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}}
0 commit comments