// RUN: %target-typecheck-verify-swift public protocol P1 { associatedtype A: P1 where A.A == A } public protocol P2 { associatedtype B: P1 associatedtype C: P2 } public struct G : P2 { public typealias C = G } // C == G together with the definition of G.C implies an infinite series // of rules: // - C.C == G // - C.C.C == G // - C.C.C.C == G // - ... // // This would normally prevent the completion procedure from terminating, // however A.A == A in protocol P1 means that the right hand sides simplify // as follows: // // - C.C == G // - C.C.C == B // - C.C.C.C == G // - ... // // Therefore, the single rule C.C == C.C.C suffices to "tie off" the recursion. public protocol P3: P2 where C == G {}