Conditional ? bug
Anders F Björklund
afb at algonet.se
Fri Oct 6 05:14:16 PDT 2006
Max Samuha wrote:
>>So you have to use "test != null ? test.foo() : 0" for that kind of
>>thing. Just "test ? test.foo() : 0" works too.
> Sorry, my fault. I should have used !is or simply test. Thanks
Not entirelly your fault, "== null" and "!= null" is common
enough to have the D compiler detect them at compile time...
Or it could just be defined to "false", like it is in Java.
(i.e. "For any non-null reference x, x == null equals false")
More information about the Digitalmars-d-bugs