Open
Description
For e.g:
struct S {
static func foo(_ x: Int) -> S { .init() }
}
func bar(_ x: S) {
switch x {
case .foo(let x): // error: 'let' binding pattern cannot appear in an expression
()
}
}
We ought to be able to improve the diagnostic to point out that you're trying to pattern match a function argument rather than an enum case.