www.digitalmars.com         C & C++   DMDScript  

D - Possible compiler error?

reply Jonathan Andrew <Jonathan_member pathlink.com> writes:
Walter, in a piece of code I was writing I had

foo =+ 0.2;

instead of the correct

foo += 0.2;

The compiler didn't pick up on it, possible error?

Thanks,
-Jon
Mar 12 2003
parent "Sean L. Palmer" <seanpalmer directvinternet.com> writes:
No, it would parse as:

foo = +0.2;

which is equivalent to:

foo = 0.2;

So your program is wrong, but the compiler is not busted.

Sean

"Jonathan Andrew" <Jonathan_member pathlink.com> wrote in message
news:b4p654$14t$1 digitaldaemon.com...
 Walter, in a piece of code I was writing I had

 foo =+ 0.2;

 instead of the correct

 foo += 0.2;

 The compiler didn't pick up on it, possible error?

 Thanks,
 -Jon

Mar 12 2003