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

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Sep 7 07:46:13 UTC 2017


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

          Issue ID: 17814
           Summary: bad output of "static foreach" with -vcg-ast
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Windows
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: r.sagitario at gmx.de

Dumping the AST of

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

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

import object;
mixin("int a" ~ i.stringof ~ " = 1;");


I'd rather expect:

import object;
int a0 = 1;
int a1 = 1;
int a2 = 1;

--


More information about the Digitalmars-d-bugs mailing list