mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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.
13 lines
258 B
Swift
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
|
|
}
|
|
}
|