www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9327] New: alias this declaration and unknown identifiers lead to segmentation fault

http://d.puremagic.com/issues/show_bug.cgi?id=9327

           Summary: alias this declaration and unknown identifiers lead to
                    segmentation fault
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: tvwhite51 gmail.com


--- Comment #0 from tvwhite51 gmail.com 2013-01-16 11:04:18 PST ---
If two classes alias this each other and their is an unknown identifier DMD
will fail with segmentation fault: 11. This is on DMD 2.061, Mac OS X 10.8.2.

Example:

class foo {
    bar fun;
    alias fun this;

    this() {
        fun = new bar(this);
        fun.a = 5; //remove this line and the program will compile.
    }
}

class bar {
    foo sun;
    alias sun this;

    this(foo t) {
        sun = t;
    }
}

void main() {
    foo fun = new foo;
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 16 2013