About switch case statements...

Walter Bright newshound1 at digitalmars.com
Sun Nov 15 18:10:54 PST 2009


Ellery Newcomer wrote:
> Just did a quick scan of phobos1. Found 5 instances of fallthrough, not
> including one around line 182, format.d
> 
>     case Mangle.Tdchar:
>       ti = typeid(dchar);
>     default:
>       ti = null;
> 
> I have a hard time believing that was intentional, although it as near
> as I can tell it will never be executed.
> 
> "Written by Walter Bright"
> 
> hm.
> 

LOL! Looks like you got me there. It appears here: 
http://www.dsource.org/projects/phobos/browser/trunk/phobos/std/format.d?rev=132
in the first version of that switch statement.

I'll check in a fix.

Lesson learned: Never open source your software! <g>



More information about the Digitalmars-d mailing list