www.digitalmars.com         C & C++   DMDScript  

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


          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 2020