www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2926] New: bug in alias this with mutually recursive structs

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

           Summary: bug in alias this with mutually recursive structs
           Product: D
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: andrei metalanguage.com


struct A(T)
{
    B!T fun()
    {
        return B!T.init;
    }
}

struct B(T)
{
    private A!T _s;
    alias _s this;
}

void main() {
    A!(int) s;
}

./test.d(15): Error: alias this there can be only one alias this
./test.d(6): Error: template instance test.B!(int) error instantiating
./test.d(15): Error: alias this there can be only one alias this


-- 
May 02 2009