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
Downgrade sendability errors to warnings when they involve non-Sendable metatypes
The introduction of non-Sendable metatypes in Swift 6.2 (via SE-0470)
will break some existing Swift 6 code. Downgrade concurrency errors
involving non-Sendable metatypes to warnings until some future
language mode to ease the transition.
Task.detached{ // expected-error{{passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure}}
82
+
Task.detached{ // expected-warning{{passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure}}
83
83
acceptMeta(x) // expected-note{{closure captures 'x' which is accessible to code in the current task}}
let _:@Sendable(Element,Element)->Bool=(>) // expected-error{{converting non-sendable function value to '@Sendable (Element, Element) -> Bool' may introduce data races}}
100
100
}
101
101
}
102
+
103
+
extensionInt:Q{
104
+
staticfunc g(){}
105
+
}
106
+
107
+
extensionString:Q{
108
+
staticfunc g(){}
109
+
}
110
+
111
+
classHolder:@uncheckedSendable{
112
+
// expected-note@+3{{disable concurrency-safety checks if accesses are protected by an external synchronization mechanism}}
113
+
// expected-note@+2{{add '@MainActor' to make static property 'globalExistentialThing' part of global actor 'MainActor'}}
114
+
// expected-warning@+1{{static property 'globalExistentialThing' is not concurrency-safe because non-'Sendable' type 'Dictionary<Int, any Q.Type>' may have shared mutable state}}
0 commit comments