[Issue 21544] New: -checkaction=context formats enum members as their base type

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jan 13 00:33:59 UTC 2021


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

          Issue ID: 21544
           Summary: -checkaction=context formats enum members as their
                    base type
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P1
         Component: druntime
          Assignee: nobody at puremagic.com
          Reporter: moonlightsentinel at disroot.org

-checkaction=context doesn't recognize enums, e.g.:

enum E { A, BCDE }

void main() 
{
    E a = E.A;
    E b = E.BCDE;
    assert(a == b);
}

core.exception.AssertError at onlineapp.d(7): 0 != 1

The error message should probably print the exact member or at least include
`cast(E)` as done e.g. for static assert.

--


More information about the Digitalmars-d-bugs mailing list