Skip to content

Commit 29c54c5

Browse files
Merge pull request #60964 from AnthonyLatsis/close-60962
Add a regression test to close #60962
2 parents 9c5fa49 + 3b5ba19 commit 29c54c5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/stmt/foreach.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,3 +250,10 @@ func test_no_ambiguity_with_prefix_iterator<C: Collection>(c: C) {
250250
for _ in c.prefix(1) { // Ok
251251
}
252252
}
253+
254+
// https://github.com/apple/swift/issues/60962
255+
// Make sure we produce a meaningful diagnostic here.
256+
do {
257+
for (x, y) in (0, 0) {}
258+
// expected-error@-1 {{for-in loop requires '(Int, Int)' to conform to 'Sequence'}}
259+
}

0 commit comments

Comments
 (0)