Skip to content

Commit 64e2e44

Browse files
committed
Add a regression test for https://bugs.swift.org/browse/SR-15790
1 parent b6a4923 commit 64e2e44

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/Generics/sr15790.swift

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// RUN: %target-swift-frontend -typecheck %s -debug-generic-signatures -requirement-machine-protocol-signatures=on 2>&1 | %FileCheck %s
2+
3+
// CHECK-LABEL: sr15790.(file).P1@
4+
// CHECK-NEXT: Requirement signature: <Self where Self.[P1]X : P1, Self.[P1]X == Self.[P1]X.[P1]X>
5+
public protocol P1 {
6+
associatedtype X: P1 where X.X == X
7+
}
8+
9+
// CHECK-LABEL: sr15790.(file).P2@
10+
// CHECK-NEXT: Requirement signature: <Self where Self : Collection, Self : P1, Self.[Sequence]Element : P1, Self.[P1]X == Self.[P2]Z.[P2]Y, Self.[P2]Y : P3, Self.[P2]Z : P2>
11+
public protocol P2: Collection, P1 where Element: P1, X == Z.Y {
12+
associatedtype Y: P3
13+
associatedtype Z: P2
14+
}
15+
16+
// CHECK-LABEL: sr15790.(file).P3@
17+
// CHECK-NEXT: Requirement signature: <Self where Self : P2, Self.[P3]T : P2>
18+
public protocol P3: P2 {
19+
associatedtype T: P2
20+
}

0 commit comments

Comments
 (0)