Skip to content

Commit e7a4e59

Browse files
authored
Merge pull request swiftlang#29130 from xedin/sr-4664
[TypeChecker] NFC: Add test-case for SR-4664
2 parents b49a834 + 308ea8a commit e7a4e59

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)