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

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Jul 5 05:54:36 PDT 2017


https://issues.dlang.org/show_bug.cgi?id=17600

          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 at puremagic.com
          Reporter: simon.buerger at 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 !
}

--


More information about the Digitalmars-d-bugs mailing list