Skip to content

Commit 8ee187e

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

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

test/Generics/rdar90506460.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+
// CHECK-LABEL: .P1@
4+
// CHECK-NEXT: Requirement signature: <Self where Self == Self.[P1]A.[P2]C, Self.[P1]A : P3, Self.[P1]B : P4, Self.[P1]A.[P2]C == Self.[P1]B.[P2]C>
5+
public protocol P1 {
6+
associatedtype A: P3 where A.C == Self
7+
associatedtype B: P4 where B.C == Self
8+
}
9+
10+
// CHECK-LABEL: .P2@
11+
// CHECK-NEXT: Requirement signature: <Self where Self : CaseIterable, Self : Hashable, Self : RawRepresentable, Self.[P2]C : P1, Self.[P2]D : P5, Self.[RawRepresentable]RawValue == String>
12+
public protocol P2: Hashable, RawRepresentable, CaseIterable where RawValue == String {
13+
associatedtype C: P1
14+
associatedtype D: P5
15+
}
16+
17+
// CHECK-LABEL: .P3@
18+
// CHECK-NEXT: Requirement signature: <Self where Self : P2>
19+
public protocol P3: P2 {}
20+
21+
// CHECK-LABEL: .P4@
22+
// CHECK-NEXT: Requirement signature: <Self where Self : P2>
23+
public protocol P4: P2 {}
24+
25+
// CHECK-LABEL: .P5@
26+
// CHECK-NEXT: Requirement signature: <Self where Self : CaseIterable, Self : Hashable, Self : RawRepresentable, Self.[RawRepresentable]RawValue == String>
27+
public protocol P5: Hashable, RawRepresentable, CaseIterable where RawValue == String {}

0 commit comments

Comments
 (0)