D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6897 - Problem allocating an array of local enums
Summary: Problem allocating an array of local enums
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: tools (show other issues)
Version: D2
Hardware: x86 Windows
: P2 normal
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2011-11-05 17:52 UTC by bearophile_hugs
Modified: 2015-06-09 04:37 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 bearophile_hugs 2011-11-05 17:52:54 UTC
This program:


import std.stdio;
enum Foo : char { A = 'a' }
void main() {
    Foo[] array = new Foo[5];
    writeln(array);
}


Prints this correct output with DMD 2.057head:

[A, A, A, A, A]


But with this very similar program:

void main() {
    enum Foo : char { A = 'a' }
    Foo[] array = new Foo[5];
}


the linker gives:

Error 42: Symbol Undefined _Dmain3Foo6__initZ
Comment 1 Andrej Mitrovic 2013-02-08 17:26:13 UTC
Resolved in git-head. There was another nested enum linker issue that was recently fixed.