Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Issue 12640 - Avoid fallthrough diagnostics when the last case/de…
…fault statement in a switch failed semantic analysis.
- Loading branch information
1 parent
6642adc
commit 567f589
Showing
2 changed files
with
32 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
TEST_OUTPUT: | ||
--- | ||
fail_compilation/diag12640.d(14): Error: undefined identifier asdf | ||
fail_compilation/diag12640.d(23): Error: undefined identifier asdf | ||
--- | ||
*/ | ||
|
||
void main() | ||
{ | ||
switch (1) | ||
{ | ||
case 0: | ||
asdf; | ||
break; | ||
|
||
default: | ||
} | ||
|
||
switch (1) | ||
{ | ||
default: | ||
asdf; | ||
break; | ||
|
||
case 0: | ||
} | ||
|
||
} | ||
|