mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
14 lines
238 B
Swift
14 lines
238 B
Swift
// RUN: %target-swift-frontend -emit-sil %s -verify
|
|
|
|
func non_fully_covered_switch(x: Int) -> Int {
|
|
var x = x
|
|
switch x {
|
|
case 0:
|
|
x += 1
|
|
case 3:
|
|
x -= 1
|
|
} // expected-error{{switch must be exhaustive}}
|
|
return x
|
|
}
|
|
|