mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Check for unsafe constructs in all modes, so that we can emit the
"unsafe does not cover any unsafe constructs" warning consistently.
One does not need to write "unsafe" outside of strict memory safety
mode, but if you do... it needs to cover unsafe behavior.
(cherry picked from commit 1b94c3b3d6)
13 lines
259 B
Swift
13 lines
259 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 2{{'let' binding pattern cannot appear in an expression}}
|
|
z
|
|
default:
|
|
z
|
|
}
|
|
}
|