Skip to content

Commit f522e56

Browse files
committed
Add regression test for rdar://problem/90506457
1 parent 8ee187e commit f522e56

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

test/Generics/rdar90506457.swift

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// RUN: %target-swift-frontend -typecheck %s -debug-generic-signatures -requirement-machine-protocol-signatures=on 2>&1 | %FileCheck %s
2+
3+
// CHECK-LABEL: .P1@
4+
// CHECK-NEXT: Requirement signature: <Self where Self.[P1]B : P2, Self.[P1]C : P4, Self.[P1]D : P5, Self.[P1]E : P6, Self.[P1]F : P3, Self.[P1]G == Self.[P1]B.[P2]G, Self.[P1]B.[P2]G == Self.[P1]C.[P4]G, Self.[P1]C.[P4]G == Self.[P1]D.[P5]G, Self.[P1]D.[P5]G == Self.[P1]E.[P6]G, Self.[P1]F.[Sequence]Element == SIMD2<Self.[P1]G>>
5+
public protocol P1 {
6+
associatedtype G
7+
associatedtype B: P2 where B.G == G
8+
associatedtype C: P4 where C.G == G
9+
associatedtype D: P5 where D.G == G
10+
associatedtype E: P6 where E.G == G
11+
associatedtype F: P3 where F.Element == SIMD2<G>
12+
}
13+
14+
// CHECK-LABEL: .P2@
15+
// CHECK-NEXT: Requirement signature: <Self where Self.[P2]A : P1, Self.[P2]C : P4, Self.[P2]D : P5, Self.[P2]E : P6, Self.[P2]G == Self.[P2]A.[P1]G, Self.[P2]A.[P1]G == Self.[P2]C.[P4]G, Self.[P2]C.[P4]G == Self.[P2]D.[P5]G, Self.[P2]D.[P5]G == Self.[P2]E.[P6]G>
16+
public protocol P2 {
17+
associatedtype G
18+
associatedtype A: P1 where A.G == G
19+
associatedtype C: P4 where C.G == G
20+
associatedtype D: P5 where D.G == G
21+
associatedtype E: P6 where E.G == G
22+
}
23+
24+
// CHECK-LABEL: .P3@
25+
// CHECK-NEXT: Requirement signature: <Self where Self : MutableCollection, Self : RandomAccessCollection, Self.[Collection]Index == Int>
26+
public protocol P3: RandomAccessCollection, MutableCollection where Index == Int {}
27+
28+
// CHECK-LABEL: .P4@
29+
// CHECK-NEXT: Requirement signature: <Self where Self.[P4]G : SIMDScalar>
30+
public protocol P4 {
31+
associatedtype G: SIMDScalar
32+
}
33+
34+
// CHECK-LABEL: .P5@
35+
// CHECK-NEXT: Requirement signature: <Self where Self.[P5]G : SIMDScalar>
36+
public protocol P5 {
37+
associatedtype G: SIMDScalar
38+
}
39+
40+
// CHECK-LABEL: .P6@
41+
// CHECK-NEXT: Requirement signature: <Self where Self.[P6]G : SIMDScalar>
42+
public protocol P6 {
43+
associatedtype G: SIMDScalar
44+
}

0 commit comments

Comments
 (0)