// RUN: %target-typecheck-verify-swift // https://github.com/apple/swift/issues/54974 protocol AnyPropertyProtocol { associatedtype Root = Any associatedtype Value = Any associatedtype KP: AnyKeyPath var key: KP { get } var value: Value { get } } // CHECK-LABEL: .PartialPropertyProtocol@ // CHECK-NEXT: Requirement signature: protocol PartialPropertyProtocol: AnyPropertyProtocol where KP: PartialKeyPath { } // CHECK-LABEL: .PropertyProtocol@ // CHECK-NEXT: Requirement signature: protocol PropertyProtocol: PartialPropertyProtocol where KP: WritableKeyPath { } extension Dictionary where Value: AnyPropertyProtocol { // CHECK-LABEL: .subscript@ // CHECK-NEXT: Generic signature: subscript(key: Key, path: WritableKeyPath) -> P? where P: PropertyProtocol, P.Root == R, P.Value == V { return self[key] as? P } }