[Issue 2087] New: Merge stc.typecons.defineEnum with enum

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri May 9 07:54:06 PDT 2008


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

           Summary: Merge stc.typecons.defineEnum with enum
           Product: D
           Version: 2.014
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: spec
          Severity: enhancement
          Priority: P5
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: arkangath at gmail.com


I find that nearly (if not) every enum in my code is defined using
std.typecons.defineEnum for the toString() and fromString() functionality.
I'd suggest moving this into the language itself. Like Objects, an enum will
have a .toString property which does exactly what is defined on the  defineEnum
mixin.
The fromString() isn't as important, but since we're at it, why not do the full
round?
Defining enums with this mixin wrecks chaos on IDE parsers, as I try to use
"MsgType" as a variable type and the IDE's parser never knows of it.


-- 



More information about the Digitalmars-d-bugs mailing list