// RUN: %target-swift-frontend -typecheck %s -debug-generic-signatures 2>&1 | %FileCheck %s class A {} class B : A {} class C : A<(T, U)> {} class D : A {} // ---------------- protocol P1 { associatedtype T where T : A associatedtype X } protocol Q1 { associatedtype T where T : B associatedtype Y } // CHECK-LABEL: .R1a@ // CHECK-NEXT: Requirement signature: protocol R1a { associatedtype T where T : P1, T : Q1, T.X == T.Y } // CHECK-LABEL: .R1b@ // CHECK-NEXT: Requirement signature: protocol R1b { associatedtype T where T : P1, T : Q1 } // ---------------- protocol P2 { associatedtype T where T : B associatedtype X } protocol Q2 { associatedtype T where T : A associatedtype Y } // CHECK-LABEL: .R2a@ // CHECK-NEXT: Requirement signature: protocol R2a { associatedtype T where T : P2, T : Q2, T.X == T.Y } // CHECK-LABEL: .R2b@ // CHECK-NEXT: Requirement signature: protocol R2b { associatedtype T where T : P2, T : Q2 } // ---------------- protocol P3 { associatedtype T where T : A associatedtype X } protocol Q3 { associatedtype T where T : C associatedtype Y associatedtype Z } // CHECK-LABEL: .R3a@ // CHECK-NEXT: Requirement signature: protocol R3a { associatedtype T where T : P3, T : Q3, T.X == (T.Y, T.Z) } // CHECK-LABEL: .R3b@ // CHECK-NEXT: Requirement signature: protocol R3b { associatedtype T where T : P3, T : Q3 } // ---------------- protocol P4 { associatedtype T where T : C associatedtype X associatedtype Y } protocol Q4 { associatedtype T where T : A associatedtype Z } // CHECK-LABEL: .R4a@ // CHECK-NEXT: Requirement signature: protocol R4a { associatedtype T where T : P4, T : Q4, T.Z == (T.X, T.Y) } // CHECK-LABEL: .R4b@ // CHECK-NEXT: Requirement signature: protocol R4b { associatedtype T where T : P4, T : Q4 } // ---------------- protocol P5 { associatedtype T where T : A associatedtype X } protocol Q5 { associatedtype T where T : D associatedtype Y associatedtype Z } // CHECK-LABEL: .R5a@ // CHECK-NEXT: Requirement signature: protocol R5a { associatedtype T where T : P5, T : Q5, T.X == T.Z } // CHECK-LABEL: .R5b@ // CHECK-NEXT: Requirement signature: protocol R5b { associatedtype T where T : P5, T : Q5 } // ---------------- protocol P6 { associatedtype T where T : D associatedtype X associatedtype Y } protocol Q6 { associatedtype T where T : A associatedtype Z } // CHECK-LABEL: .R6a@ // CHECK-NEXT: Requirement signature: protocol R6a { associatedtype T where T : P6, T : Q6, T.Z == T.Y } // CHECK-LABEL: .R6b@ // CHECK-NEXT: Requirement signature: protocol R6b { associatedtype T where T : P6, T : Q6 } // ---------------- // CHECK-LABEL: .P7@ // CHECK-NEXT: Requirement signature: protocol P7 { associatedtype V where V : P1, V.T : A associatedtype W }