[Bug 35] New: missleading error message for circular constructor paths

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Mar 11 08:46:30 PST 2006


http://d.puremagic.com/bugzilla/show_bug.cgi?id=35

           Summary: missleading error message for circular constructor paths
           Product: D
           Version: 0.149
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: minor
          Priority: P5
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: thomas-dloop at kuehne.cn


class A{
        this(int i){
        }
}

class B : A{
        this(int i){
                this = new C(i);
        }
}

class C : B{
        this(int i){
        }
}

class A{
        this(int i){
        }
}

class B : A{
        this(int i){
                this = new C(i);
        }
}

class C : B{
        this(int i){
        }
}


DMD-0.149 reports:
a.d(2): constructor a.A.this (int) does not match argument types ()
Error: expected 1 arguments, not 0

a.d(7): constructor a.B.this (int) does not match argument types ()
Error: expected 1 arguments, not 0

The real cause aren't unexpected numbers of arguments but a circular
constructor path between a.C (line 13) and a.B(line 8).


-- 




More information about the Digitalmars-d-bugs mailing list