Open
Description
Description
The new sendable key path diagnostics seems to lose writability when appending a sendable, writable key path.
Reproduction
struct S {
var p = 0
}
struct T {
var s = S()
}
func f() {
let kp1: WritableKeyPath<T, S> & Sendable = \T.s
let kp2: WritableKeyPath<T, Int> & Sendable = kp1.appending(path: \.p)
}
Expected behavior
kp2
should compile, but we get:
Error: Cannot convert value of type 'KeyPath<T, Int>' to specified type 'WritableKeyPath<T, Int>'
Environment
swift-driver version: 1.112.3 Apple Swift version 6.0 (swiftlang-6.0.0.6.8 clang-1600.0.23.1)
Target: arm64-apple-macosx14.0
Additional information
No response