[Bug 24] Arithmetic operators are allowed on boolean expressions

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Mar 9 16:46:25 PST 2006


http://d.puremagic.com/bugzilla/show_bug.cgi?id=24





------- Comment #3 from ddparnell at bigpond.com  2006-03-09 18:46 -------
But you originally said it was a bug. I refer you to ...

http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D.announce/3039
 -------------------
"Derek Parnell" <derek at psych.ward> wrote in message 
news:1o1ukrzuobjw5$.19cyl0ofx7fqs$.dlg at 40tude.net...
> It seems that arithmetic operators also work on booleans so I guess the
> operator list above is either not correct or this is a bug.

It's a bug. Sigh. It always takes me two tries to get this right :-( 
 -------------------

So I still maintain that this is a mistake.

  bool x = true + true;

Should not compile. The promotion to ints must occur after the initial
semantics of the expression are validated.


-- 




More information about the Digitalmars-d-bugs mailing list