www.digitalmars.com         C & C++   DMDScript  

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

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 puremagic.com
          Reporter: r.sagitario 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;

--
Sep 07 2017