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
[SE-0470] Teach @sendable inference on static methods about non-sendable metatypes
The code that determines whether a reference to a static method (that
is not a call) assumed that metatypes were always Sendable. This is no
longer the case, so update this code to go through the normal Sendable
checking on the metatype.
x.g() // okay, because T is Sendable implies T.Type: Sendable
88
88
}
89
89
}
90
+
91
+
structGenericThingy<Element>{
92
+
func searchMe(_:(Element,Element)->Bool){}
93
+
94
+
func test()where Element:Comparable{
95
+
// Ensure that this we infer a non-@Sendable function type for Comparable.<
96
+
searchMe(<)
97
+
98
+
let _:(Element,Element)->Bool=(>)
99
+
let _:@Sendable(Element,Element)->Bool=(>) // expected-error{{converting non-sendable function value to '@Sendable (Element, Element) -> Bool' may introduce data races}}
0 commit comments