[Issue 17814] bad output of "static foreach" with -vcg-ast

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Sep 7 19:59:26 UTC 2017


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

timon.gehr at gmx.ch changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |timon.gehr at gmx.ch

--- Comment #2 from timon.gehr at gmx.ch ---
Dumping the AST of:

static if(true){
    enum a = 1;
}

with "dmd -c -vcg-ast test.d" yields:

import object;
static if (true)
{
    enum int a = 1;
}


Therefore, shouldn't the expected output be:

static foreach(enum i; 0..3)
{
    mixin("int a" ~ i.stringof ~ " = 1;");
}

?

--


More information about the Digitalmars-d-bugs mailing list