http://d.puremagic.com/issues/show_bug.cgi?id=3841
Summary: silent implicit cast from floating point to integral
in += etc. operators
Product: D
Version: unspecified
Platform: Other
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Andrei Alexandrescu <[email protected]> 2010-02-22
10:28:45 PST ---
void main() {
uint a;
float b = 0.1;
a += b;
}
This program compiles no problem. This is obviously a problem and a very
surprising behavior; I'm at the end of a 2-hours bug chasing and tried this
only after I eliminated all other opportunities for error.
For numeric types, It is ok for built-in += to perform narrowing conversion,
but not truncating ones.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------