Files
swift-mirror/test/FixCode/fixits-empty-switch-multifile.swift
Hamish Knight 4a04aa4485 [Sema] Consolidate missing switch case notes
Rather than emitting a note for each case, just emit a single note
for all the cases, with each case printed in the message, up to a
column limit. `@unknown case` still gets its own note since it
includes some useful explanation.

rdar://143342616
2026-07-24 22:40:19 +01:00

9 lines
333 B
Swift

// RUN: %target-typecheck-verify-swift %s %S/Inputs/fixits-enum-multifile.swift -I %S/Inputs
func foo1(_ e: EMulti) {
switch e {
// expected-error@-1 {{switch must be exhaustive}}
// expected-note@-2 {{add missing cases: '.e1', '.e2', '.e3(_)'}} {{+3:3-3=case .e1:\n<#code#>\ncase .e2:\n<#code#>\ncase .e3(_):\n<#code#>\n}}
}
}