Skip to content

Commit 308ea8a

Browse files
committed
[TypeChecker] NFC: Add test-case for SR-4664
Resolves: rdar://problem/31764828
1 parent a584202 commit 308ea8a

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

test/Constraints/sr4664.swift

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+
struct M<T> where T : Collection { // expected-note {{where 'T' = 'X.Y'}}
4+
static func f(a: T, b: T) -> [E<T.Iterator.Element>] {
5+
}
6+
}
7+
8+
enum E<T> {}
9+
10+
struct S {}
11+
12+
struct X {
13+
struct Y {
14+
let s: [S]
15+
}
16+
17+
let y: [Y]
18+
}
19+
20+
let x = X(y: [])
21+
let a = M.f(a: x.y[0], b: x.y[1])
22+
// expected-error@-1 {{generic struct 'M' requires that 'X.Y' conform to 'Collection'}}

0 commit comments

Comments
 (0)