[Issue 16570] [REG 2.072.0-b1] Enum member with interpreted initializer has type of initializer not enum

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Oct 2 15:50:48 PDT 2016


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

Martin Nowak <code at dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |code at dawg.eu
            Summary|[REG 2.072.0-b1] implicit   |[REG 2.072.0-b1] Enum
                   |conversion from int to enum |member with interpreted
                   |fails when enum type is     |initializer has type of
                   |missing                     |initializer not enum

--- Comment #1 from Martin Nowak <code at dawg.eu> ---
cat > bug.d << CODE
static immutable int _a = 0;

enum Regression
{
    a = _a,
}

static assert(is(typeof(Regression.a) == Regression));
CODE
dmd -c bug
----
bug.d(8): Error: static assert  (is(int == Regression)) is false
----

Digger says that https://github.com/dlang/dmd/pull/5878 introduced the bug,
seems reasonable (see
https://github.com/dlang/dmd/pull/5878/files#diff-bbe16dab8171d70a98ca3272a1efcc4aR633).

--


More information about the Digitalmars-d-bugs mailing list