Files
swift-mirror/test/Constraints/issue-66553.swift
Hamish Knight 10ed17549c [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.
2025-09-09 13:48:40 +01:00

13 lines
258 B
Swift

// RUN: %target-typecheck-verify-swift
// https://github.com/apple/swift/issues/66553
func baz(y: [Int], z: Int) -> Int {
switch z {
case y[let z]: // expected-error {{'let' binding pattern cannot appear in an expression}}
z
default:
z
}
}