Skip to content

Commit 3ee6325

Browse files
authored
Merge pull request #39869 from slavapestov/another-rqm-testcase
RequirementMachine: Add another requirement signature minimization test case
2 parents 1b746e5 + 91f8804 commit 3ee6325

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

test/Generics/confluent_example.swift

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// RUN: %target-swift-frontend -typecheck %s -debug-generic-signatures -requirement-machine-protocol-signatures=on 2>&1 | %FileCheck %s
2+
3+
// The GSB crashes with P1 and P2, and rejects P3.
4+
5+
// CHECK-LABEL: confluent_example.(file).P1@
6+
// CHECK-LABEL: Requirement signature: <Self where Self.A : P1, Self.A == Self.A.B, Self.B : P1, Self.B == Self.B.C, Self.C : P1>
7+
protocol P1 {
8+
associatedtype A : P1
9+
associatedtype B : P1
10+
associatedtype C : P1 where A.B == A, B.C == B
11+
}
12+
13+
// CHECK-LABEL: confluent_example.(file).P2@
14+
// CHECK-LABEL: Requirement signature: <Self where Self.A : P2, Self.A == Self.A.B, Self.B : P2, Self.B == Self.B.C, Self.C : P2>
15+
protocol P2 {
16+
associatedtype A : P2
17+
associatedtype B : P2
18+
associatedtype C : P2 where A.B == A, B.C == B, A.C == A
19+
}
20+
21+
// CHECK-LABEL: confluent_example.(file).P3@
22+
// CHECK-LABEL: Requirement signature: <Self where Self.A : P3, Self.A == Self.A.B, Self.B : P3, Self.B == Self.B.C, Self.C : P3>
23+
protocol P3 {
24+
associatedtype A where A.B : P3
25+
associatedtype B where B.C : P3
26+
associatedtype C : P3 where A.B == A, B.C == B, A.C == A
27+
}

0 commit comments

Comments
 (0)