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
Copy file name to clipboardExpand all lines: test/Concurrency/sendable_checking.swift
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -97,7 +97,7 @@ public actor MyActor: MyProto {
97
97
func g(ns1:NS1)async{
98
98
awaitnonisolatedAsyncFunc1(ns1) // expected-targeted-and-complete-warning{{passing argument of non-sendable type 'NS1' outside of actor-isolated context may introduce data races}}
99
99
// expected-tns-warning @-1 {{sending 'ns1' may cause a data race}}
100
-
// expected-tns-note @-2 {{sending actor-isolated 'ns1' to nonisolated callee could cause races between nonisolated and actor-isolated uses}}
100
+
// expected-tns-note @-2 {{sending actor-isolated 'ns1' to nonisolated global function 'nonisolatedAsyncFunc1' risks causing data races between nonisolated and actor-isolated uses}}
101
101
_ =awaitnonisolatedAsyncFunc2() // expected-warning{{non-sendable type 'NS1' returned by implicitly asynchronous call to nonisolated function cannot cross actor boundary}}
102
102
}
103
103
}
@@ -254,12 +254,12 @@ final class NonSendable {
254
254
awaitupdate()
255
255
// expected-targeted-and-complete-warning @-1 {{passing argument of non-sendable type 'NonSendable' into main actor-isolated context may introduce data races}}
256
256
// expected-tns-warning @-2 {{sending 'self' may cause a data race}}
257
-
// expected-tns-note @-3 {{sending task-isolated 'self' to main actor-isolated callee could cause races between main actor-isolated and task-isolated uses}}
257
+
// expected-tns-note @-3 {{sending task-isolated 'self' to main actor-isolated instance method 'update()' risks causing data races between main actor-isolated and task-isolated uses}}
258
258
259
259
awaitself.update()
260
260
// expected-targeted-and-complete-warning @-1 {{passing argument of non-sendable type 'NonSendable' into main actor-isolated context may introduce data races}}
261
261
// expected-tns-warning @-2 {{sending 'self' may cause a data race}}
262
-
// expected-tns-note @-3 {{sending task-isolated 'self' to main actor-isolated callee could cause races between main actor-isolated and task-isolated uses}}
262
+
// expected-tns-note @-3 {{sending task-isolated 'self' to main actor-isolated instance method 'update()' risks causing data races between main actor-isolated and task-isolated uses}}
263
263
264
264
_ =await x
265
265
// expected-warning@-1 {{non-sendable type 'NonSendable' passed in implicitly asynchronous call to main actor-isolated property 'x' cannot cross actor boundary}}
// expected-targeted-and-complete-warning @-1 {{passing argument of non-sendable type 'NonSendable' into main actor-isolated context may introduce data races}}
280
280
// expected-tns-warning @-2 {{sending 't' may cause a data race}}
281
-
// expected-tns-note @-3 {{sending disconnected 't' to main actor-isolated callee could cause races in between callee main actor-isolated and local nonisolated uses}}
281
+
// expected-tns-note @-3 {{sending disconnected 't' to main actor-isolated instance method 'update()' risks causing data races between main actor-isolated and local nonisolated uses}}
282
282
283
283
_ =await t.x
284
284
// expected-warning @-1 {{non-sendable type 'NonSendable' passed in implicitly asynchronous call to main actor-isolated property 'x' cannot cross actor boundary}}
// expected-targeted-and-complete-warning @-1 {{passing argument of non-sendable type 'NonSendable' outside of main actor-isolated context may introduce data races}}
300
300
// expected-tns-warning @-2 {{sending 'ns' may cause a data race}}
301
-
// expected-tns-note @-3 {{sending main actor-isolated 'ns' to nonisolated callee could cause races between nonisolated and main actor-isolated uses}}
301
+
// expected-tns-note @-3 {{sending main actor-isolated 'ns' to nonisolated callee risks causing data races between nonisolated and main actor-isolated uses}}
// expected-targeted-and-complete-warning@-1 {{passing argument of non-sendable type 'NonSendable' outside of main actor-isolated context may introduce data races}}
306
306
// expected-tns-warning @-2 {{sending 'ns' may cause a data race}}
307
-
// expected-tns-note @-3 {{sending main actor-isolated 'ns' to nonisolated callee could cause races between nonisolated and main actor-isolated uses}}
307
+
// expected-tns-note @-3 {{sending main actor-isolated 'ns' to nonisolated callee risks causing data races between nonisolated and main actor-isolated uses}}
0 commit comments