Open
Description
Description
I've encountered an issue where the debugDescription
property of KeyPath
can produce incorrect string representations.
Reproduction
struct Foo { }
struct Bar { }
struct Foobar {
let foo: Foo
let bar: Bar
}
print(\Foobar.foo) // prints: '\Foobar.foo'
print(\Foobar.bar) // prints: '\Foobar.foo' <-- unexpected, should be '\Foobar.bar'
Expected behavior
The second print statement should output \Foobar.bar
, matching the key path's property name.
Environment
swift-driver version: 1.115.1 Apple Swift version 6.0.3 (swiftlang-6.0.3.1.10 clang-1600.0.30.1)
Target: arm64-apple-macosx15.0
Additional information
No response