Skip to content

Commit 86bfe3a

Browse files
authored
Merge pull request #80302 from slavapestov/anthony-fixed-it-already
Add regression test for fixed crasher
2 parents 97b249b + c200b0b commit 86bfe3a

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// RUN: %target-typecheck-verify-swift
2+
3+
protocol Q {
4+
func foo()
5+
}
6+
7+
protocol P<T>: AnyObject {
8+
associatedtype T: Q
9+
}
10+
11+
final class C<T: Q>: P {
12+
}
13+
14+
struct S: Q {
15+
func foo() {}
16+
}
17+
18+
// This used to return an ErrorType and crash
19+
20+
func testit() -> P<S> { // expected-warning {{use of protocol 'P' as a type must be written 'any P'}}
21+
return C<S>()
22+
}

0 commit comments

Comments
 (0)