Bug 6897 – Problem allocating an array of local enums
Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
tools
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2011-11-05T17:52:00Z
Last change time
2015-06-09T04:37:41Z
Keywords
rejects-valid
Assigned to
nobody
Creator
bearophile_hugs
Comments
Comment #0 by bearophile_hugs — 2011-11-05T17:52:54Z
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 by andrej.mitrovich — 2013-02-08T17:26:13Z
Resolved in git-head. There was another nested enum linker issue that was recently fixed.