Summary: Incorrect value range propagation for addition
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

This code doesn't compile and it should:

void main()
    byte x, y, z;
    short a = x+y;

Although the manifest type of x+y is int, the actual range of x+y, regardless
of the values of x and y, is -byte.min-byte.min to byte.max+byte.max. That
range fits properly in a short so the compiler should let the code go through.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to