Skip to content

Commit 075e7c1

Browse files
committed
RequirementMachine: Add regression test for rdar://problem/90402519
1 parent ae2feb5 commit 075e7c1

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

test/Generics/rdar90402519.swift

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// RUN: %target-typecheck-verify-swift
2+
3+
// This needs a better diagnostic. The real problem is the 'C == G<I>'
4+
// requirement in P2 conflicts with the one in P1.
5+
6+
protocol P {
7+
associatedtype I
8+
}
9+
10+
struct G1<I> : P {}
11+
struct G2<T> : P {
12+
typealias I = G<T>
13+
}
14+
15+
struct G<T> {}
16+
17+
protocol P0 {
18+
associatedtype C : P
19+
}
20+
21+
protocol P1 : P0 where C == G1<I> {
22+
associatedtype I
23+
}
24+
25+
protocol P2 : P1 where C == G2<I> {}
26+
// expected-error@-1 {{cannot build rewrite system for protocol; concrete nesting limit exceeded}}
27+
// expected-note@-2 {{failed rewrite rule is [P2:I].[concrete: G<G<G<G<G<G<G<G<G<G<G<G<G<G<G<G<G<G<G<G<G<G<G<G<G<G<G<G<G<G<[P2:I]>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] => [P2:I]}}

0 commit comments

Comments
 (0)