Files
swift-mirror/test/stmt/switch_stmt1.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

14 lines
413 B
Swift

// RUN: %target-typecheck-verify-swift
enum E {
case e1
case e2
}
func foo1(e : E, i : Int) {
switch e {} // expected-error{{switch must be exhaustive}}
// expected-note@-1 {{missing case: '.e1'}}
// expected-note@-2 {{missing case: '.e2'}}
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}}
}