| 1 |
/* |
| 2 |
TEST_OUTPUT: |
| 3 |
--- |
| 4 |
fail_compilation/test22999.d(17): Error: switch case fallthrough - use 'goto default;' if intended |
| 5 |
fail_compilation/test22999.d(24): Error: switch case fallthrough - use 'goto case;' if intended |
| 6 |
--- |
| 7 |
*/ |
| 8 |
|
| 9 |
// no switch fallthrough error with multi-valued case |
| 10 |
// https://issues.dlang.org/show_bug.cgi?id=22999 |
| 11 |
void main() |
| 12 |
{ |
| 13 |
int i; |
| 14 |
switch (0) |
| 15 |
{ |
| 16 |
case 0, 1: i = 20; |
| 17 |
default: assert(0); |
| 18 |
} |
| 19 |
|
| 20 |
switch (0) |
| 21 |
{ |
| 22 |
default: |
| 23 |
case 0, 1: i = 20; |
| 24 |
case 2, 3: i = 30; |
| 25 |
} |
| 26 |
} |