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
awaittransferToMain(y) // expected-warning {{sending 'y' risks causing data races}}
114
114
// expected-note @-1 {{sending task-isolated 'y' to main actor-isolated global function 'transferToMain' risks causing data races between main actor-isolated and task-isolated uses}}
awaittransferToMain(x) // expected-warning {{sending 'x' risks causing data races}}
119
119
// expected-note @-1 {{sending 'x' to main actor-isolated global function 'transferToMain' risks causing data races between main actor-isolated and local nonisolated uses}}
120
120
121
121
// TODO: We should not error on this since we are sending to the same place.
122
122
awaittransferToMain(x) // expected-note {{access can happen concurrently}}
awaittransferToMain(x) // expected-warning {{sending 'x' risks causing data races}}
127
127
// expected-note @-1 {{sending 'x' to main actor-isolated global function 'transferToMain' risks causing data races between main actor-isolated and local nonisolated uses}}
128
128
useValue(x) // expected-note {{access can happen concurrently}}
awaittransferToMain(y) // expected-warning {{sending 'y' risks causing data races}}
137
137
// expected-note @-1 {{sending 'self'-isolated 'y' to main actor-isolated global function 'transferToMain' risks causing data races between main actor-isolated and 'self'-isolated uses}}
awaittransferToMain(x) // expected-warning {{sending 'x' risks causing data races}}
142
142
// expected-note @-1 {{sending 'x' to main actor-isolated global function 'transferToMain' risks causing data races between main actor-isolated and local actor-isolated uses}}
143
143
awaittransferToMain(x) // expected-note {{access can happen concurrently}}
awaittransferToMain(x) // expected-warning {{sending 'x' risks causing data races}}
148
148
// expected-note @-1 {{sending 'x' to main actor-isolated global function 'transferToMain' risks causing data races between main actor-isolated and local actor-isolated uses}}
149
149
useValue(x) // expected-note {{access can happen concurrently}}
150
150
}
151
151
152
152
// After assigning into the actor, we can still use x in the actor as long as
awaittransferToMain(x) // expected-warning {{sending 'x' risks causing data races}}
163
163
// expected-note @-1 {{sending 'self'-isolated 'x' to main actor-isolated global function 'transferToMain' risks causing data races between main actor-isolated and 'self'-isolated uses}}
// TODO: This is incorrect! sending should be independent of @MainActor.
174
174
awaittransferToCustom(x) // expected-warning {{sending 'x' risks causing data races}}
175
175
// expected-note @-1 {{sending main actor-isolated 'x' to global actor 'CustomActor'-isolated global function 'transferToCustom' risks causing data races between global actor 'CustomActor'-isolated and main actor-isolated uses}}
awaittransferToCustom(globalKlass) // expected-warning {{sending main actor-isolated value of type 'Klass' with later accesses to global actor 'CustomActor'-isolated context risks causing data races}}
awaittransferToCustom(globalKlass) // expected-warning {{sending main actor-isolated value of type 'NonSendableKlass' with later accesses to global actor 'CustomActor'-isolated context risks causing data races}}
awaittransferToMain(x) // expected-warning {{sending 'x' risks causing data races}}
212
212
// expected-note @-1 {{sending 'x' to main actor-isolated global function 'transferToMain' risks causing data races between main actor-isolated and local nonisolated uses}}
awaittransferToMain(y) // expected-warning {{sending 'y' risks causing data races}}
346
346
// expected-note @-1 {{sending 'y' to main actor-isolated global function 'transferToMain' risks causing data races between main actor-isolated and local nonisolated uses}}
347
347
x = y // expected-note {{access can happen concurrently}}
awaittransferToMain(x) // expected-warning {{sending 'x' risks causing data races}}
389
389
// expected-note @-1 {{sending task-isolated 'x' to main actor-isolated global function 'transferToMain' risks causing data races between main actor-isolated and task-isolated uses}}
awaittransferToCustom(x) // expected-warning {{sending 'x' risks causing data races}}
395
395
// expected-note @-1 {{sending main actor-isolated 'x' to global actor 'CustomActor'-isolated global function 'transferToCustom' risks causing data races between global actor 'CustomActor'-isolated and main actor-isolated uses}}
0 commit comments