Files
swift-mirror/test/Constraints/issue-66553.swift
Doug Gregor 60024c3c3b Always emit "unsafe does not cover any unsafe constructs" warning
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)
2025-05-29 15:10:43 -07:00

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
}
}