// RUN: %target-typecheck-verify-swift // While we disallow explicitly-stated requirements like // `T: C`, there are ways to sneak them past the // diagnostic. // // We could relax the diagnostic eventually by rejecting // the truly invalid cases, where the superclass contains // a member type of a conformance made redundant by the // superclass requirement itself. class C { var t: T init(t: T) { self.t = t } } protocol P1 { associatedtype A: C associatedtype B: P1 } func f(_: T, t: T.A) -> C { return t.t.t.t } protocol P2 { associatedtype A: C associatedtype B } extension P2 where Self == A { func f() -> C { return self } } extension P2 where Self == A, A == B { func g() -> C { return self } }