[Sema/IDE] Emit same diagnostics for missing switch cases independent of editor mode

This commit is contained in:
Alex Hoppen
2024-08-08 16:08:46 -07:00
parent 1d485486e1
commit 7d7eb6e61d
25 changed files with 303 additions and 1179 deletions

View File

@@ -166,6 +166,7 @@ struct ContainsEnum {
switch n { // expected-error {{switch must be exhaustive}}
// expected-note@-1 {{missing case: '.Mere(_)'}}
// expected-note@-2 {{missing case: '.Twain(_, _)'}}
// expected-note@-3 {{add missing cases}}
case ContainsEnum.Possible<Int>.Naught,
ContainsEnum.Possible.Naught, // expected-warning {{case is already handled by previous patterns; consider removing it}}
Possible<Int>.Naught, // expected-warning {{case is already handled by previous patterns; consider removing it}}
@@ -180,6 +181,7 @@ func nonmemberAccessesMemberType(_ n: ContainsEnum.Possible<Int>) {
switch n { // expected-error {{switch must be exhaustive}}
// expected-note@-1 {{missing case: '.Mere(_)'}}
// expected-note@-2 {{missing case: '.Twain(_, _)'}}
// expected-note@-3 {{add missing cases}}
case ContainsEnum.Possible<Int>.Naught,
.Naught: // expected-warning {{case is already handled by previous patterns; consider removing it}}
()