[Issue 6916] New: writeln of nameless enum

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Nov 8 19:24:34 PST 2011


http://d.puremagic.com/issues/show_bug.cgi?id=6916

           Summary: writeln of nameless enum
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2011-11-08 19:23:58 PST ---
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?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list