www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19778] New: ICE when accessing empty array at compile time

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

          Issue ID: 19778
           Summary: ICE when accessing empty array at compile time
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: tim.dlang t-online.de

The following code compiles with DMD 2.084.0, but not with DMD 2.085.0,
2.085.1-beta.1 or 2.085.0-master-0e9418f:

struct S
{
        int[] data;
}
immutable X = S([]);
enum len = X.data.length;
void main()
{
}

Using DMD 2.085.0, 2.085.1-beta.1 or 2.085.0-master-0e9418f produces the
following error:
test.d(6): Error: Internal Compiler Error: null field data

--
Mar 30 2019