[Issue 16346] New: Enum used as a constructor evaluates to the underlying type, not to the enum type.

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Aug 1 07:00:32 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=16346

          Issue ID: 16346
           Summary: Enum used as a constructor evaluates to the underlying
                    type, not to the enum type.
           Product: D
           Version: D2
          Hardware: All
               URL: http://dlang.org/
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P3
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: eyal at weka.io

Test case:

enum A { B }
static assert(is(typeof(A.B) == A)); // succeeds
static assert(is(typeof(A(A.B)) == A)); // fails

--


More information about the Digitalmars-d-bugs mailing list