mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[CS] Set the naming pattern in markInvalid
This normally gets populated by successful type-checking, we still want to populate it if we fail though to avoid attempting to type-check the parent statement again.
This commit is contained in:
@@ -406,7 +406,7 @@ func testNonBinding5(_ x: Int, y: [Int]) {
|
||||
func testNonBinding6(y: [Int], z: Int) -> Int {
|
||||
switch 0 {
|
||||
// We treat 'z' here as a binding, which is invalid.
|
||||
case let y[z]: // expected-error 2{{pattern variable binding cannot appear in an expression}}
|
||||
case let y[z]: // expected-error {{pattern variable binding cannot appear in an expression}}
|
||||
z
|
||||
case y[z]: // This is fine
|
||||
0
|
||||
|
||||
Reference in New Issue
Block a user