When I create a switch
statement in VS2008 C# like this (contrived):
switch (state) {
case '1':
state = '2';
case '2':
state = '1';
}
it complains that I'm not allowed to drop through:
Control cannot fall through from one case label ('case '1' (0x31):') to another
If you're not allowed to drop through, then what is the purpose of the break
statement at all? Why didn't the language designers just leave it out and automatically jump to the end of the switch
statement instead of forcing us to put in an unnecessary construct?