Era Scarecrow:

Maybe variable declaration (as long as they are default(s))? Has a certain amount of sense, but makes more sense to do it outside the switch case...

Declaring variables there is dangerous:

import std.stdio;
struct Foo {
    int x = 10;
}
void main() {
    int bar;
    switch(bar) {
        Foo f;
        case 10: break;
        default: writeln(f); // prints garbage
    }
}


Bye,
bearophile

Reply via email to