[Issue 9999] Integer literal 0 and 1 should prefer integer type in overload resolution

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Apr 27 20:43:08 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=9999


Jonathan M Davis <jmdavisProg at gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jmdavisProg at gmx.com


--- Comment #6 from Jonathan M Davis <jmdavisProg at gmx.com> 2013-04-27 20:43:01 PDT ---
If you simply made it so that integer literals didn't implicitly convert to
bool, that would solve this particular problem. There's really no need to have
them implicitly convert to bool as that's what true and false are for. But it
_would_ mean that integer literals behaved differently from actual integers
(though I am firmly in the camp who thinks that integers shouldn't implicitly
convert to bool in the first place).

Another alternative would be to simply remove bool from Value Range
Propagation, as it really doesn't help with bool at all. It _would_ be another
special case, but it would be a fairly simple one, and neither of these
suggestions require special casing overloads, just implicit conversions of
integer literals.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list