mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
26 lines
504 B
Swift
26 lines
504 B
Swift
// RUN: %target-typecheck-verify-swift
|
|
|
|
enum Bar {
|
|
case Simple
|
|
case Complex(Int)
|
|
}
|
|
|
|
func optEnumContext() -> Bar? {
|
|
switch () {
|
|
case ():
|
|
return .Simple
|
|
case (): // expected-warning {{case is already handled by previous patterns; consider removing it}}
|
|
return .Complex(0)
|
|
}
|
|
}
|
|
|
|
func iuoEnumContext() -> Bar! {
|
|
switch () {
|
|
case ():
|
|
return .Simple
|
|
case (): // expected-warning {{case is already handled by previous patterns; consider removing it}}
|
|
return .Complex(0)
|
|
}
|
|
}
|
|
|