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/sendnonsendable_basic.swift
+4-6Lines changed: 4 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -263,10 +263,10 @@ extension Actor {
263
263
}
264
264
}
265
265
266
-
// We emit the first error that we see. So we do not emit the self error.
267
266
await transferToMain(closure) // expected-sns-note {{access here could race}}
268
-
// expected-complete-warning @-1 {{passing argument of non-sendable type '() -> ()' into main actor-isolated context may introduce data races}}
269
-
// expected-complete-note @-2 {{a function type must be marked '@Sendable' to conform to 'Sendable'}}
267
+
// expected-sns-warning @-1 {{call site passes `self` or a non-sendable argument of this function to another thread, potentially yielding a race with the caller}}
268
+
// expected-complete-warning @-2 {{passing argument of non-sendable type '() -> ()' into main actor-isolated context may introduce data races}}
269
+
// expected-complete-note @-3 {{a function type must be marked '@Sendable' to conform to 'Sendable'}}
270
270
}
271
271
272
272
// In this case, we reinit along both paths, but only one has an actor derived
@@ -286,9 +286,7 @@ extension Actor {
286
286
closure ={}
287
287
}
288
288
289
-
// TODO: We do not error here yet since we are performing the control flow
290
-
// union incorrectly.
291
-
awaittransferToMain(closure)
289
+
awaittransferToMain(closure) // expected-sns-warning {{call site passes `self` or a non-sendable argument of this function to another thread, potentially yielding a race with the caller}}
292
290
// expected-complete-warning @-1 {{passing argument of non-sendable type '() -> ()' into main actor-isolated context may introduce data races}}
293
291
// expected-complete-note @-2 {{a function type must be marked '@Sendable' to conform to 'Sendable'}}
0 commit comments