www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14218] New: casting null to integer type causes error message

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

          Issue ID: 14218
           Summary: casting null to integer type causes error message
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: r.sagitario gmx.de

With dmd-2067-beta2:

void main()
{
    auto sz = cast(long)null;
}

test.d(5): Error: e2ir: cannot cast null of type typeof(null) to type long

Any cast of null to an integer type seems to fail, but works in 2.066.

--
Feb 23 2015