[Issue 22981] Another forward reference bug involving a string mixin

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Apr 4 07:49:39 UTC 2022


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

--- Comment #1 from Max Samukha <maxsamukha at gmail.com> ---
(In reply to Max Samukha from comment #0)

> The test case compiles if the enum is wrapped in a template:

However, it doesn't if the template instance is aliased:

template E_()
{
        mixin ("enum E_ {", S.attr, "}");
}

alias E = E_!();

struct S
{
    E e;
    enum attr = "a";
}

onlineapp.d(12): Error: template instance `onlineapp.E_!()` is used as a type
onlineapp.d(8): Error: template instance `onlineapp.E_!()` error instantiating

--


More information about the Digitalmars-d-bugs mailing list