// RUN: %target-swift-frontend -typecheck -verify %s protocol Nested { associatedtype U // expected-note {{protocol requires nested type 'U'; do you want to add it?}} } class A { func f(_ t: T, _ keyPath: WritableKeyPath) {} } class B : Nested { // expected-error {{type 'B' does not conform to protocol 'Nested'}} 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'}} } }