Summary: Mixin forward reference semantic run leads to
                    inconsistent AST
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD

--- Comment #0 from klickverbot <> 2012-09-06 13:52:33 PDT 
See the discussion at,
this bug is just to make sure the issue doesn't get lost.

mixin template mix7974() {
 uint _x;

struct Foo7974 {
 immutable fa = Foo7974(0);

 this(uint x) {
   _x = x;
 mixin mix7974!();

To recapitulate, the issue in the snippet is that the full semantic pass for
mix7974, including the arrayCopy() of its members to the surrounding scope, is
run twice at two separate points in time. Some parts of the resulting AST
reference the _x declaration from the first run, and some that from the second.

Looking at TemplateMixin::semantic, this behavior seems to be somewhat
intended, but the outcome is a bug, as Walter confirmed (and a major problem
for LDC codegen).

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to