Skip to content

Commit e0a9a74

Browse files
[NFC] Add minimal test case for rdar://problem/58578342.
1 parent 5e0226f commit e0a9a74

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/Sema/exhaustive_switch.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,6 +1407,17 @@ enum SR11212Tests {
14071407
}
14081408
}
14091409

1410+
// rdar://problem/58578342
1411+
func sr11212_content_generic_pattern_untupled3(b: Box<((Int, Int), Int)>) -> (Int, Int, Int) {
1412+
switch b {
1413+
// expected-note@-1 {{add missing case: '.box((_, _))'}}
1414+
// expected-error@-2 {{switch must be exhaustive}}
1415+
// FIXME: This should not be an error, analogous to the test cases above.
1416+
case let .box((x, y), z): return (x, y, z)
1417+
// expected-warning@-1 {{the enum case has a single tuple as an associated value, but there are several patterns here, implicitly tupling the patterns and trying to match that instead}}
1418+
}
1419+
}
1420+
14101421
func sr11212_content_generic_pattern_ambiguous1(b: Box<(Int, Int)>) -> (Int, Int) {
14111422
switch b {
14121423
case .box(let b_): return b_

0 commit comments

Comments
 (0)