On 14.09.2011 22:52, simendsjo wrote:
Not sure if this is a bug or as intended.
import std.stdio;
void main() {
int i = 1;
switch(i) {
case 0:
writeln("case 0");
goto default; // needed here
default:
writeln("default");
// But always falls through here
aLabel:
writeln("a label");
}
}
Label doesn't affect switch statement in any way, e.g. it's not part of
case x: synatx, and as such is "fallthrough" like in normal code.
So this part works as intended, though I agree with bearophile there are
some messy things w.r.t. switch.
--
Dmitry Olshansky