Comment #0 by bearophile_hugs — 2013-03-03T17:26:28Z
void main() {
int x;
switch ('x') {
case 'a':
x++;
case 'b': .. case 'c':
x++;
break;
default:
}
}
With dmd 2.063alpha it compiles with no errors nor warnings. But I think it should give an error like:
test.d(6): Error: switch case fallthrough - use 'goto default;' if intended
Comment #1 by andrej.mitrovich — 2013-03-03T17:34:42Z
It looks like it wasn't properly implemented, e.g. this will error with -w:
void main() {
int x;
switch ('x') {
case 'a':
x++;
case 'b':// .. case 'c':
x++;
break;
default:
}
}
Note the commented out code. Tested in 2.063 -- 2.060.
Comment #2 by r.sagitario — 2013-12-15T06:01:55Z
*** This issue has been marked as a duplicate of issue 11653 ***