Switch case falltrhough, regression or intended behavior ?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Feb 17 08:24:19 PST 2013


On 2/17/13 11:10 AM, deadalnix wrote:
> I have several instance of cases like this :
>
> switch(c) {
> case 'U', 'u' :
> case 'L', 'l' :
> // code . . .
> }
>
> dmd from master complains about it (Error: switch case fallthrough - use
> 'goto case;' if intended). It used to work.
>
> Note that in that case, the fix is trivial, but I don't really see the
> point in changing such behavior.

If there's no intervening code between cases, it should just work.

Andrei


More information about the Digitalmars-d mailing list