www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20710] New: ICE when statically accessing struct member

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

          Issue ID: 20710
           Summary: ICE when statically accessing struct member containing
                    empty array
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: andy.pj.hanson gmail.com

```
immutable A a = A(B([]));
immutable B b = a.b;

struct A {
        B b;
}

struct B {
        int[] c;
}
```

Compiling this code with `dmd app.d` results in:

`app.d(2): Error: Internal Compiler Error: null field b`

Tested with DMD v2.091.0 .

--
Mar 30