1+ // RUN: %target-swift-frontend -typecheck %s -debug-generic-signatures -requirement-machine-protocol-signatures=verify 2>&1 | %FileCheck %s
2+
3+ public protocol P1 {
4+ associatedtype X
5+ }
6+
7+ public protocol P2 { }
8+
9+ ////
10+
11+ // CHECK-LABEL: conformance_requirement_in_original_protocol.(file).Q1a@
12+ // CHECK-LABEL: Requirement signature: <Self where Self == Self.Y.Z, Self.Y : Q1b>
13+
14+ public protocol Q1a {
15+ associatedtype Y : Q1b where Self == Self . Y . Z
16+ }
17+
18+ // CHECK-LABEL: conformance_requirement_in_original_protocol.(file).Q1b@
19+ // CHECK-LABEL: Requirement signature: <Self where Self.Z : P1, Self.Z : Q1a, Self.Z.X : P2>
20+
21+ public protocol Q1b {
22+ associatedtype Z : Q1a , P1 where Self. Z. X : P2
23+ }
24+
25+ ////
26+
27+ // CHECK-LABEL: conformance_requirement_in_original_protocol.(file).Q2a@
28+ // CHECK-LABEL: Requirement signature: <Self where Self.Z : P1, Self.Z : Q2b, Self.Z.X : P2>
29+
30+ public protocol Q2a {
31+ associatedtype Z : Q2b , P1 where Self. Z. X : P2
32+ }
33+
34+ // CHECK-LABEL: conformance_requirement_in_original_protocol.(file).Q2b@
35+ // CHECK-LABEL: Requirement signature: <Self where Self == Self.Y.Z, Self.Y : Q2a>
36+
37+ public protocol Q2b {
38+ associatedtype Y : Q2a where Self == Self . Y . Z
39+ }
40+
41+ ////
42+
43+ // CHECK-LABEL: conformance_requirement_in_original_protocol.(file).Q3a@
44+ // CHECK-LABEL: Requirement signature: <Self where Self : P1, Self == Self.Y.Z, Self.X : P2, Self.Y : Q3b>
45+
46+ public protocol Q3a : P1 {
47+ associatedtype Y : Q3b where Self == Self . Y . Z , Self. X : P2
48+ }
49+
50+ // CHECK-LABEL: conformance_requirement_in_original_protocol.(file).Q3b@
51+ // CHECK-LABEL: Requirement signature: <Self where Self.Z : Q3a>
52+
53+ public protocol Q3b {
54+ associatedtype Z : Q3a
55+ }
56+
57+ ////
58+
59+ // CHECK-LABEL: conformance_requirement_in_original_protocol.(file).Q4a@
60+ // CHECK-LABEL: Requirement signature: <Self where Self.Z : Q4b>
61+
62+ public protocol Q4a {
63+ associatedtype Z : Q4b
64+ }
65+
66+ // CHECK-LABEL: conformance_requirement_in_original_protocol.(file).Q4b@
67+ // CHECK-LABEL: Requirement signature: <Self where Self : P1, Self == Self.Y.Z, Self.X : P2, Self.Y : Q4a>
68+
69+ public protocol Q4b : P1 {
70+ associatedtype Y : Q4a where Self == Self . Y . Z , Self. X : P2
71+ }
72+
73+ ////
74+
75+ // CHECK-LABEL: conformance_requirement_in_original_protocol.(file).Q5a@
76+ // CHECK-LABEL: Requirement signature: <Self where Self == Self.Y.Z, Self.X : P2, Self.Y : Q5b>
77+
78+ public protocol Q5a {
79+ associatedtype Y : Q5b where Self == Self . Y . Z , Self. X : P2
80+ }
81+
82+ // CHECK-LABEL: conformance_requirement_in_original_protocol.(file).Q5b@
83+ // CHECK-LABEL: Requirement signature: <Self where Self.Z : P1, Self.Z : Q5a>
84+
85+ public protocol Q5b {
86+ associatedtype Z : Q5a , P1
87+ }
88+
89+ ///
90+
91+ // CHECK-LABEL: conformance_requirement_in_original_protocol.(file).Q6a@
92+ // CHECK-LABEL: Requirement signature: <Self where Self.Z : P1, Self.Z : Q6b>
93+
94+ public protocol Q6a {
95+ associatedtype Z : Q6b , P1
96+ }
97+
98+ // CHECK-LABEL: conformance_requirement_in_original_protocol.(file).Q6b@
99+ // CHECK-LABEL: Requirement signature: <Self where Self == Self.Y.Z, Self.X : P2, Self.Y : Q6a>
100+
101+ public protocol Q6b {
102+ associatedtype Y : Q6a where Self == Self . Y . Z , Self. X : P2
103+ }
104+
105+ ////
106+
107+ // CHECK-LABEL: conformance_requirement_in_original_protocol.(file).Q7a@
108+ // CHECK-LABEL: Requirement signature: <Self where Self : P1, Self == Self.Y.Z, Self.Y : Q7b>
109+
110+ public protocol Q7a : P1 {
111+ associatedtype Y : Q7b where Self == Self . Y . Z
112+ }
113+
114+ // CHECK-LABEL: conformance_requirement_in_original_protocol.(file).Q7b@
115+ // CHECK-LABEL: Requirement signature: <Self where Self.Z : Q7a, Self.Z.X : P2>
116+
117+ public protocol Q7b {
118+ associatedtype Z : Q7a where Self. Z. X : P2
119+ }
120+
121+ ////
122+
123+ // CHECK-LABEL: conformance_requirement_in_original_protocol.(file).Q8a@
124+ // CHECK-LABEL: Requirement signature: <Self where Self.Z : Q8b, Self.Z.X : P2>
125+
126+ public protocol Q8a {
127+ associatedtype Z : Q8b where Self. Z. X : P2
128+ }
129+
130+ // CHECK-LABEL: conformance_requirement_in_original_protocol.(file).Q8b@
131+ // CHECK-LABEL: Requirement signature: <Self where Self : P1, Self == Self.Y.Z, Self.Y : Q8a>
132+
133+ public protocol Q8b : P1 {
134+ associatedtype Y : Q8a where Self == Self . Y . Z
135+ }
0 commit comments