Skip to content

Commit a0480b6

Browse files
committed
Add two regression tests for bugs already fixed
1 parent ada2e40 commit a0480b6

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// RUN: %target-typecheck-verify-swift
2+
3+
struct G<T> {}
4+
5+
protocol P {
6+
associatedtype T
7+
associatedtype U
8+
}
9+
10+
protocol Q: P where T == G<U> {}
11+
12+
protocol R: Q where U == Int {}
13+
14+
struct X: R {}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// RUN: %target-typecheck-verify-swift
2+
3+
struct Composite<Foo> { }
4+
5+
protocol Chain {
6+
associatedtype Next: Chain
7+
associatedtype Foo = Composite<Next.Foo>
8+
}
9+
10+
// expected-error@+3 {{cannot build rewrite system for protocol; rule length limit exceeded}}
11+
// expected-note@+2 {{failed rewrite rule}}
12+
// expected-error@+1 {{'Foo' is not a member type of type 'Self.Next'}}
13+
protocol OtherChain where Foo == Composite<Next.Foo> {
14+
associatedtype Next: OtherChain
15+
associatedtype Foo
16+
}

0 commit comments

Comments
 (0)