mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
There's still plenty of more work to do here for pattern diagnostics, including introducing a bunch of new locator elements, and handling things like argument list mismatches. This at least lets us fall back to a generic mismatch diagnostic.
14 lines
301 B
Swift
14 lines
301 B
Swift
// RUN: %target-typecheck-verify-swift
|
||
|
||
// rdar://107709341 – Make sure we don't crash.
|
||
func foo(_ x: Int) {
|
||
let _ = {
|
||
switch x {
|
||
case Optional<Int>.some(x): // expected-error {{pattern of type 'Optional<Int>' cannot match 'Int'}} {{none}}
|
||
break
|
||
default:
|
||
break
|
||
}
|
||
}
|
||
}
|