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


Jonathan M Davis <jmdavisp...@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jmdavisp...@gmx.com


--- Comment #25 from Jonathan M Davis <jmdavisp...@gmx.com> 2012-10-12 19:42:37 
PDT ---
> trivially incorrect use of op assignment operator is allowed:

Your example is perfectly valid. D uses range value propagation:

http://www.drdobbs.com/tools/value-range-propagation/229300211

It knows the value of both x and y, so it knows that x |= y; will work just
fine, because all of the values will fit in the correct types. If the value in
y was too large to fit in a ushort, _then_ it should give you an error, but
since it fits in a ushort just fine (and is positive, so there's no issues with
two's complement or whatnot), the compiler knows that it's fine and allows it
without complaint.

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

Reply via email to