D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 20710 - ICE when statically accessing struct member containing empty array
Summary: ICE when statically accessing struct member containing empty array
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2020-03-31 03:45 UTC by andy-hanson
Modified: 2020-06-08 10:08 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description andy-hanson 2020-03-31 03:45:05 UTC
```
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 .
Comment 1 Dlang Bot 2020-06-04 20:56:43 UTC
@BorisCarvajal created dlang/dmd pull request #11225 "Fix Issue 20710 - ICE when statically accessing struct member contain…" fixing this issue:

- Fix Issue 20710 - ICE when statically accessing struct member containing empty array

https://github.com/dlang/dmd/pull/11225
Comment 2 Dlang Bot 2020-06-08 10:08:46 UTC
dlang/dmd pull request #11225 "Fix Issue 20710 - ICE when statically accessing struct member contain…" was merged into stable:

- cad8f7af5f37b631bf68115bf4faa89e89abbe64 by Boris Carvajal:
  Fix Issue 20710 - ICE when statically accessing struct member containing empty array

https://github.com/dlang/dmd/pull/11225