EndianStream needs to be reexamined!

Bruno Medeiros brunodomedeiros+spam at com.gmail
Sun Apr 27 16:16:34 PDT 2008


Anders F Björklund wrote:
> Bruno Medeiros wrote:
> 
>>>> Can we please have this bug be a compile-time error?  (Walter, I 
>>>> wonder if you could run the exercise like you did for the class != 
>>>> null where you build a compiler that flags this as a failure and see 
>>>> how many errors are found?)
>>>
>>> I think that's a good idea. I'll give it a try.
>>
>> Gotta say, told ya so.
> 
> Isn't this what the compiler warnings do ?
> 
> "warning - std/stream.d(2217): class std.stream.EndianStream Stream read 
> is hidden in EndianStream"
> 
> --anders

Yes, it's what they do *now*. But when the feature was first introduced 
they threw a runtime error. I warned against it from the start:
"There is a problem the moment the D subclass doesn't override all
overloads, so that can be detected at compile time and an error issued
right there."
(http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=56419)



-- 
Bruno Medeiros - Software Developer, MSc. in CS/E graduate
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D



More information about the Digitalmars-d mailing list