Files
swift-mirror/test/stmt/switch_stmt_editor1.swift
Nishith Shah 8e2e625543 [Diagnostics] Use imperative msg for protocol conformance & switch-case fixits
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.
2023-08-13 22:34:26 -07:00

13 lines
441 B
Swift

// RUN: %target-typecheck-verify-swift -diagnostics-editor-mode
enum E {
case e1
case e2
}
func foo1(e : E, i : Int) {
switch e {} // expected-error{{switch must be exhaustive}}
// expected-note@-1{{add missing cases}}{{13-13=case .e1:\n<#code#>\ncase .e2:\n<#code#>\n}}
switch i {} // expected-error{{'switch' statement body must have at least one 'case' or 'default' block; add a default case}}{{13-13=default:\n<#code#>\n}}
}