www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17600] New: implicit float->int cast using += operator


          Issue ID: 17600
           Summary: implicit float->int cast using += operator
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: simon.buerger rwth-aachen.de

The following code should not compile but it does, using an implicit cast that
should not be allowed.

void main()
 int x;
 float y;
 x += y; // implicitly casts y to int !

Jul 05 2017