www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8626] New: Mixin forward reference semantic run leads to inconsistent AST

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8626

           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
        AssignedTo: nobody puremagic.com
        ReportedBy: code klickverbot.at



---
See the discussion at
http://forum.dlang.org/thread/CAP9J_HV9YLEkwsFD=e3YT2Juxr0=Kb6sxJNnc2UP4Tr1qmz4+w mail.gmail.com,
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: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 06 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8626




To: David Nadlinger

Is this the problem that you had explained in the forum recently?
If so, it is correctly asserted in dmd source code now.

StructDeclaration::semantic
https://github.com/D-Programming-Language/dmd/pull/1760

ClassDeclaration::semantic and InterfaceDeclaration::semantic
https://github.com/D-Programming-Language/dmd/pull/1822

Therefore, can I mark this "RESOLVED FIXED"?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 06 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8626




PDT ---
No, this is a much earlier, distinct bug report. However, it is likely related
in terms of the root cause, so it might be fixed just as well. I suppose I have
to re-enable the 7494 test case on LDC to see if it passes – which commits to
I
need to back-port to 2.062?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 06 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8626





 No, this is a much earlier, distinct bug report. However, it is likely related
 in terms of the root cause, so it might be fixed just as well. I suppose I have
 to re-enable the 7494 test case on LDC to see if it passes – which commits
to I
 need to back-port to 2.062?
in 2.063 may be related to it . So I'm worried about the possibility that the back-port does not work... -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Apr 06 2013