// RUN: %target-swift-frontend -typecheck -verify %s // https://github.com/apple/swift/issues/52995 protocol Nested { associatedtype U // expected-note {{protocol requires nested type 'U'}} } class A { func f(_ t: T, _ keyPath: WritableKeyPath) {} } class B : Nested { // expected-error {{type 'B' does not conform to protocol 'Nested'}} expected-note {{add stubs for conformance}} var i: Y? } class C { func cFunc(_ a: A) { let function: (B, ReferenceWritableKeyPath) -> Void = a.f // expected-error {{cannot convert value of type '(B, WritableKeyPath.U>) -> ()' to specified type '(B, ReferenceWritableKeyPath) -> Void'}} } }