www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6916] New: writeln of nameless enum

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: bearophile_hugs eml.cc



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: -------
Nov 08 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6916




Maybe related to issue 5004

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 15 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6916


bearophile_hugs eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID



It can't work like this.

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