Hi! I'm working with some KeyPath
types and Strict Concurrency. I'm seeing some warnings and trying to following along with SE-0418[1]… but I'm not sure I understand how I can make the compiler happy.
Here is a (simple) example:
struct User {
var name: String
}
let name: KeyPath<User, String> & Sendable = \.name
// warning: Type 'WritableKeyPath<User, String>' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
My understanding (from SE-0418) is this explicit adoption of Sendable
should be ok… is there something I am missing here?
This is building from Xcode 16.0 beta (16A5171c). My swift package requires 6.0 and adds enableExperimentalFeature("StrictConcurrency")
.