On 09/14/2011 08:52 PM, 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");
}
}

This is as intended. Labels and case/default statements are not the same thing. As an example, case/default statements introduce a new scope, while labels do not.

Reply via email to