Bug 1174 – Program hangs creating an array of enums with nonzero initializer
Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
All
Creation time
2007-04-21T10:16:00Z
Last change time
2014-02-16T15:23:28Z
Keywords
wrong-code
Assigned to
bugzilla
Creator
matti.niemenmaa+dbugzilla
Comments
Comment #0 by matti.niemenmaa+dbugzilla — 2007-04-21T10:16:30Z
enum Enum {
A = 1
}
void main() {
Enum[] enums = new Enum[1];
}
DMD compiles the above fine, but it seems the call to __d_newarray never returns. Using the .length method instead of new fails in the same way, but changing A = 1 to A = 0 (or adding another member with a value of zero prior to A) makes it work.