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
[rbi] Teach SendNonSendable how to more aggressively suppress sending errors around obfuscated Sendable functions
Specifically the type checker to work around interface types not having
isolation introduces casts into the AST that enrich the AST with isolation
information. Part of that information is Sendable. This means that we can
sometimes lose due to conversions that a function is actually Sendable. To work
around this, we today suppress those errors when they are emitted (post 6.2, we
should just change their classification as being Sendable... but I don't want to
make that change now).
This change just makes the pattern matching for these conversions handle more
cases so that transfernonsendable_closureliterals_isolationinference.swift now
passes.
Copy file name to clipboardExpand all lines: test/Concurrency/transfernonsendable_global_actor_sending.swift
+2-3Lines changed: 2 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -34,9 +34,8 @@ func useValue<T>(_ t: T) {}
34
34
@MainActorfunc testGlobalFakeInit(){
35
35
letns=NonSendableKlass()
36
36
37
-
// Will be resolved once @MainActor is @Sendable.
38
-
Task.fakeInit{@MainActorin // expected-error {{passing closure as a 'sending' parameter risks causing data races between main actor-isolated code and concurrent execution of the closure}}
39
-
print(ns) // expected-note {{closure captures 'ns' which is accessible to main actor-isolated code}}
0 commit comments