Skip to content

Commit 74ee6b5

Browse files
committed
Add regression test to close #43334
1 parent 2a84083 commit 74ee6b5

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

test/Parse/switch.swift

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ func enumElementSyntaxOnTuple() {
314314
}
315315
}
316316

317-
// sr-176
317+
// https://github.com/apple/swift/issues/42798
318318
enum Whatever { case Thing }
319319
func f0(values: [Whatever]) { // expected-note {{'values' declared here}}
320320
switch value { // expected-error {{cannot find 'value' in scope; did you mean 'values'?}}
@@ -323,7 +323,8 @@ func f0(values: [Whatever]) { // expected-note {{'values' declared here}}
323323
}
324324
}
325325

326-
// sr-720
326+
// https://github.com/apple/swift/issues/43334
327+
// https://github.com/apple/swift/issues/43335
327328
enum Whichever {
328329
case Thing
329330
static let title = "title"
@@ -348,6 +349,12 @@ func f1(x: String, y: Whichever) {
348349
case Whichever.title: // expected-error {{expression pattern of type 'String' cannot match values of type 'Whichever'}}
349350
break
350351
}
352+
switch y {
353+
case .alias:
354+
break
355+
default:
356+
break
357+
}
351358
}
352359

353360

0 commit comments

Comments
 (0)