[Issue 1610] New: Enum.stringof is int, not the name of the enum

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Oct 24 08:56:33 PDT 2007


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

           Summary: Enum.stringof is int, not the name of the enum
           Product: D
           Version: 2.007
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: andrei at metalanguage.com


import std.stdio;
enum ABC { a, b, c }
void main() { writeln(ABC.stringof); } // prints "int"

This causes major issues in reflective and serialization code. The .stringof
should evaluate to the name of the enum, e.g. "ABC".


-- 



More information about the Digitalmars-d-bugs mailing list