Bug 6078 – CTFE: ICE on foreach over array struct member which is null

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
tools
Product
D
Version
D2
Platform
x86
OS
All
Creation time
2011-05-29T11:31:00Z
Last change time
2015-06-09T01:33:30Z
Keywords
ice-on-valid-code
Assigned to
nobody
Creator
code

Comments

Comment #0 by code — 2011-05-29T11:31:41Z
struct Foo { int[] bar; } enum baz = { Foo f; int i; foreach (e; f.bar) { i += e; } return i; }(); --- With latest DMD from Git master (c1b7e0a): Assertion failed: ((newval->op == TOKarrayliteral || newval->op == TOKassocarrayliteral || newval->op == TOKstring || newval->op == TOKslice || newval->op == TOKnull)), function interpretAssignCommon, file interpret.c, line 2563.
Comment #1 by clugdbug — 2011-06-01T22:50:41Z