[Issue 1977] Relax warnings (D1)/errors (D2) for implicit narrowing conversions caused by promotions

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Oct 13 04:29:05 PDT 2012


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



--- Comment #26 from Ryuichi OHORI <r.97all at gmail.com> 2012-10-13 04:28:56 PDT ---
> Your example is perfectly valid.
I don't see. In the example above( http://dpaste.dzfl.pl/8b9f5471 ), the value
in y is 16777216, which is greater than ushort.max.

> 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: -------


More information about the Digitalmars-d-bugs mailing list