My Kingdom For ...

Ary Borenszweig ary at esperanto.org.ar
Thu Feb 21 12:12:33 PST 2008


Janice Caron escribió:
> On 21/02/2008, Bill Baxter <dnewsgroup at billbaxter.com> wrote:
>> I'd vote enthusiastically for issuing a warning, but I don't like the
>>  idea of changing behavior just for that one special case.
> 
> I'd be inclined to agree, but for the fact that D doesn't have warnings.
> 
> So, you could say, second best option, make it a compile error.
> 
>     if (c == null) // ERROR
> 
> Anyone see any problem with that?

I did it in Descent as a warning, but then it appeared in lot of places 
in phobos, so that definitely doesn't work (I removed it from Descent). 
It must only be an error if c is a class reference. If it's a pointer, 
it's ok. Any other case?



More information about the Digitalmars-d mailing list