www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21279] New: cast expression between integer types is not

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

          Issue ID: 21279
           Summary: cast expression between integer types is not defined
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: spec
          Severity: normal
          Priority: P1
         Component: dlang.org
          Assignee: nobody puremagic.com
          Reporter: schveiguy yahoo.com

It was pointed out to me that there is nothing in the spect that defines
casting between integer types of different sizes.

For example:

auto x = cast(int)long.max;

There is nothing in the spec that says what should happen here. Of course, we
all know what it should and does do. It should be spelled out.

Also I cannot find "Value Range Propagation" anywhere in the spec. Somewhat
related.

--
Sep 25 2020