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
@@ -281,10 +292,10 @@ func mergeDoesNotEliminateEarlierTransfer(_ x: transferring NonSendableStruct) a
281
292
awaittransferToMain(x) // expected-warning {{transferring 'x' may cause a race}}
282
293
// expected-note @-1 {{'x' is transferred from nonisolated caller to main actor-isolated callee. Later uses in caller could race with potential uses in callee}}
283
294
284
-
// y is assigned into a field of x, so we treat this like a merge.
285
-
x.first = y
295
+
// y is assigned into a field of x.
296
+
x.first = y // expected-note {{access here could race}}
286
297
287
-
useValue(x) // expected-note {{access here could race}}
awaittransferToMain(x) // expected-warning {{transferring 'x' may cause a race}}
300
311
// expected-note @-1 {{'x' is transferred from nonisolated caller to main actor-isolated callee. Later uses in caller could race with potential uses in callee}}
301
312
302
-
// y is assigned into a field of x, so we treat this like a merge.
303
-
x.first = y // expected-warning {{transferring value of non-Sendable type 'Klass' into transferring parameter; later accesses could race}}
304
-
305
-
useValue(x) // expected-note {{access here could race}}
306
-
307
-
useValue(y) // expected-note {{access here could race}}
313
+
x.first = y // expected-note {{access here could race}}
x = y // expected-warning {{assigning 'y' to transferring parameter 'x' may cause a race}}
324
-
// expected-note @-1 {{'y' is a task isolated value that is assigned into transferring parameter 'x'. Transferred uses of 'x' may race with caller uses of 'y'}}
x = y.0 // expected-warning {{assigning 'y.0' to transferring parameter 'x' may cause a race}}
329
-
// expected-note @-1 {{'y.0' is a task isolated value that is assigned into transferring parameter 'x'. Transferred uses of 'x' may race with caller uses of 'y.0'}}
x = y.first // expected-warning {{assigning 'y.first' to transferring parameter 'x' may cause a race}}
334
-
// expected-note @-1 {{'y.first' is a task isolated value that is assigned into transferring parameter 'x'. Transferred uses of 'x' may race with caller uses of 'y.first'}}
x = y.1.second // expected-warning {{assigning 'y.1.second' to transferring parameter 'x' may cause a race}}
339
-
// expected-note @-1 {{'y.1.second' is a task isolated value that is assigned into transferring parameter 'x'. Transferred uses of 'x' may race with caller uses of 'y.1.second'}}
x = y.ns1.second // expected-warning {{assigning 'y.ns1.second' to transferring parameter 'x' may cause a race}}
344
-
// expected-note @-1 {{'y.ns1.second' is a task isolated value that is assigned into transferring parameter 'x'}}
345
-
x = y.ns2.1.second // expected-warning {{assigning 'y.ns2.1.second' to transferring parameter 'x' may cause a race}}
346
-
// expected-note @-1 {{'y.ns2.1.second' is a task isolated value that is assigned into transferring parameter 'x'. Transferred uses of 'x' may race with caller uses of 'y.ns2.1.second'}}
x = y // expected-error {{assigning 'y' to transferring parameter 'x' may cause a race}}
43
-
// expected-note @-1 {{'y' is a task isolated value that is assigned into transferring parameter 'x'. Transferred uses of 'x' may race with caller uses of 'y'}}
0 commit comments