mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
This commit changes fixit messages from a question/suggestion to an imperative message for protocol conformances and switch-case. Addresses https://github.com/apple/swift/issues/67510.
21 lines
468 B
Swift
21 lines
468 B
Swift
// RUN: %target-typecheck-verify-swift -emit-sil -diagnostics-editor-mode
|
|
|
|
enum E {
|
|
case e1
|
|
case e2
|
|
}
|
|
|
|
func foo1(e : E) {
|
|
// expected-note@+1{{add missing cases}}{{+2:3-3=case .e2:\n<#code#>\n}}
|
|
switch e { // expected-error{{switch must be exhaustive}}
|
|
case .e1: return
|
|
}
|
|
}
|
|
|
|
func foo2(i : Int) {
|
|
// expected-note@+1{{add a default clause}}{{+2:3-3=default:\n<#code#>\n}}
|
|
switch i { // expected-error{{switch must be exhaustive}}
|
|
case 1: return
|
|
}
|
|
}
|