Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

What really grinds my gears.

Name: Anonymous 2011-10-16 22:47

If I do this with C#:

switch(foo) {
    case 0:
    case 1:
}


Visual studio gives me an error because some idiot decided that in C# it won't let you fall through to the next case label anymore.

But if I do this:

switch(foo) {
    case 0:
        int bar = 3;
        break;
    case 1:
        int bar = 4;
        break;
}


It gives me an error about redefining my variable, EVEN THOUGH YOU'VE FORCED ME TO MAKE EVERY "case" CLAUSE A COMPLETELY SEPARATE ENTITY.

Name: Anonymous 2011-10-17 2:54

>>5
Both break the compile

First case:
error CS0163: Control cannot fall through from one case label ('case 1:') to another

Second:
error CS0128: A local variable named 'bar' is already defined in this scope

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List