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-note @-1 {{sending value of non-Sendable type 'NonSendableKlass' to main actor-isolated global function 'transferToMain' risks causing data races between main actor-isolated and local nonisolated uses}}
30
30
print(x) // expected-note {{access can happen concurrently}}
31
31
}
32
+
33
+
func isolatedClosureTest()async{
34
+
letx=NonSendableKlass()
35
+
let _ ={@MainActorin
36
+
print(x) // expected-error {{sending value of non-Sendable type 'NonSendableKlass' risks causing data races}}
37
+
// expected-note @-1 {{sending value of non-Sendable type 'NonSendableKlass' to main actor-isolated closure due to closure capture risks causing races in between main actor-isolated and nonisolated uses}}
38
+
}
39
+
print(x) // expected-note {{access can happen concurrently}}
0 commit comments