3 ms·
Same here, plus I think the parent brakes are noise, can the compiler just know that the switch statement ends on last case?
by ivanca 10y ago
Same here, plus I think the parent brakes are noise, can the compiler just know that the switch statement ends on last case?
- 72deluxe 10y agoNo, as in some instances you may wish to do the same thing for two case statements, so you need it to fall through case1 into case2. In other situations, you really don't want it to do that, so a break is required. How would the compiler know the difference? Note that you can't "fall through" cases in Swift, and it is irritating. It stops you using the same code for two case statements - you have to duplicate it or put it into a function.
- breakingcups 10y agoNot with nested switch statements.
- ivanca 10y ago...I don't want to ever have to work with your code.