About switch case statements...

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Nov 16 00:37:55 PST 2009


Walter Bright wrote:
> 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>

I was hoping the lesson learned would be to fix switch as was suggested.

Andrei



More information about the Digitalmars-d mailing list