Bug 6916 – writeln of nameless enum

Status
RESOLVED
Resolution
INVALID
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-11-08T19:23:00Z
Last change time
2011-11-17T15:48:09Z
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2011-11-08T19:23:58Z
D2 code: import std.stdio; enum E : int { A, B } void main() { writeln(E.B); } Nice runtime output, DMD 2.057head: B A second D2 program: import std.stdio; enum : int { A, B } void main() { writeln(B); } Runtime output, DMD 2.057head: 1 Is it possible for writeln() to write the handy enum name "B" in this case too?
Comment #1 by bearophile_hugs — 2011-11-15T23:54:16Z
Maybe related to issue 5004
Comment #2 by bearophile_hugs — 2011-11-17T15:48:09Z
It can't work like this.