Skip to content

Commit bbf7e7a

Browse files
Add test case characterizing issue in SR-11160.
1 parent 4851942 commit bbf7e7a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/Sema/exhaustive_switch.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,6 +1176,14 @@ func sr10301_as(_ foo: SR10301<String,(Int,Error)>) {
11761176
}
11771177
}
11781178

1179+
func sr11160() {
1180+
switch Optional<(Int, Int)>((5, 6)) { // expected-error {{switch must be exhaustive}}
1181+
// expected-note@-1 {{add missing case: '.some(_, _)'}}
1182+
case let b?: print(b)
1183+
case nil: print(0)
1184+
}
1185+
}
1186+
11791187
// SR-11212 tests: Some of the tests here rely on compiler bugs related to
11801188
// implicit (un)tupling in patterns. When you add a warning for the erroneous
11811189
// cases, feel free to add expected notes as appropriate.

0 commit comments

Comments
 (0)