public struct A { public var x: Int { return 0 } // NB: These declarations intentionally do not constrain the index type // to be Hashable, to ensure that we get the Hashable conformance from // the context where the key path was formed for equality while using the // property descriptor's accessors. public subscript(withGeneric index: T) -> T { return index } public private(set) subscript(withGenericPrivateSet index: T) -> T { get { return index } set { } } public subscript(withGenericSettable index: T) -> T { get { return index } set { } } public var storedA: B public private(set) var storedB: Double public var y: Int { get { return 0 } set { } } public private(set) var z: Int { get { return 0 } set { } } } public struct B { public var x: Int { return 0 } public var y: Int { get { return 0 } set { } } public private(set) var z: Int { get { return 0 } set { } } public subscript(withInt i: Int) -> Int { return i } // NB: These declarations intentionally do not constrain the index type // to be Hashable, to ensure that we get the Hashable conformance from // the context where the key path was formed for equality while using the // property descriptor's accessors. public subscript(withGeneric i: T) -> T { return i } public private(set) subscript(withGenericPrivateSet index: T) -> T { get { return index } set { } } public subscript(withGenericSettable index: T) -> T { get { return index } set { } } public var storedA: U public internal(set) var storedB: U } public func A_x_keypath() -> KeyPath { return \A.x } public func A_y_keypath() -> KeyPath { return \A.y } public func A_z_keypath() -> KeyPath { return \A.z } public func A_subscript_withGeneric_keypath(index: T) -> KeyPath { return \A.[withGeneric: index] } public func A_subscript_withGeneric_butt_keypath() -> KeyPath { return \A.[withGeneric: "pomeranian's big butt"] } public func B_subscript_withInt_keypath(_: T.Type, index: Int) -> KeyPath, Int> { return \B.[withInt: index] } public func B_Double_subscript_withInt_0_keypath() -> KeyPath, Int> { return \B.[withInt: 0] } public func B_subscript_withGeneric_keypath( _: T.Type, index: U ) -> KeyPath, U> { return \B.[withGeneric: index] } public func B_Double_subscript_withGeneric_butt_keypath() -> KeyPath, String> { return \B.[withGeneric: "Never is the universal butt type"] } public func A_storedA_keypath() -> KeyPath> { return \A.storedA } public func A_storedA_storedB_keypath() -> KeyPath { return \A.storedA.storedB } public func A_storedB_keypath() -> KeyPath { return \A.storedB } public func B_x_keypath(_: T.Type) -> KeyPath, Int> { return \B.x } public func B_y_keypath(_: T.Type) -> KeyPath, Int> { return \B.y } public func B_z_keypath(_: T.Type) -> KeyPath, Int> { return \B.z } public func B_Int_x_keypath() -> KeyPath, Int> { return \B.x } public func B_Int_y_keypath() -> KeyPath, Int> { return \B.y } public func B_Int_z_keypath() -> KeyPath, Int> { return \B.z } public func B_storedA_keypath(_: T.Type) -> KeyPath, T> { return \B.storedA } public func B_storedB_keypath(_: T.Type) -> KeyPath, T> { return \B.storedB } public func B_Int_storedA_keypath() -> KeyPath, Int> { return \B.storedA } public func B_Int_storedB_keypath() -> KeyPath, Int> { return \B.storedB }