mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Extend `ExtraneousArgumentsFailure` to handle enum element pattern mismatches. Resolves: rdar://123466496
17 lines
342 B
Swift
17 lines
342 B
Swift
// RUN: %target-typecheck-verify-swift
|
||
|
||
// rdar://107724970 – Make sure we don't crash.
|
||
enum E {
|
||
case e(Int)
|
||
}
|
||
func foo(_ x: E) {
|
||
// https://github.com/apple/swift/issues/65062
|
||
let fn = {
|
||
switch x {
|
||
case E.e(_, _):
|
||
// expected-error@-1 {{tuple pattern has the wrong length for tuple type 'Int'}}
|
||
break
|
||
}
|
||
}
|
||
}
|