KeyPath
に WritableKeyPath
を結合しても KeyPath
であってほしい気が。 https://developer.apple.com/documentation/swift/keypath/2945102-appendingstruct Foo { var a: Int } struct Bar { var foo: Foo } let k1: KeyPath<Bar, Foo> = \.foo let k2: WritableKeyPath<Foo, Int> = \.a let k: WritableKeyPath<Bar, Int> = k1.appending(path: k2)