[Issue 2940] null is null cannot be evaluated at compile time

2014-04-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=2940

Walter Bright bugzi...@digitalmars.com changed:

   What|Removed |Added

Version|1.042   |D1

--


[Issue 2940] null is null cannot be evaluated at compile time

2009-05-05 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2940





--- Comment #1 from clugd...@yahoo.com.au  2009-05-05 03:01 ---
PATCH in optimize.c, line 779, in IdentityExp::optimize(int result)
Just allow TOKnull as one of the parameters.

OLD:
if (this-e1-isConst()  this-e2-isConst())
{
e = Identity(op, type, this-e1, this-e2);
}
NEW:
if ((this-e1-isConst() || this-e1-op == TOKnull) 
(this-e2-isConst()|| this-e2-op == TOKnull))
{
e = Identity(op, type, this-e1, this-e2);
}


-- 



[Issue 2940] null is null cannot be evaluated at compile time

2009-05-05 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2940





--- Comment #2 from to...@famolsen.dk  2009-05-05 06:35 ---
Does things break if NullExp::isConst() was just implemented? After all, null
is constant...


--