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

           Summary: accepts-invalid Cyclic constructor calls cause stack
                    overflow
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: andrej.mitrov...@gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrov...@gmail.com> 2010-08-01 
13:45:41 PDT ---
On this page:

http://www.digitalmars.com/d/2.0/class.html

It states "It is illegal for constructors to mutually call each other". This
will compile and cause a stack overflow:

import std.stdio;

class C {
    this() { this(1); }
    this(int i) { this(); }    // illegal, cyclic constructor calls
}

void main() {
    C c = new C;
}

object.Error: Stack Overflow

Isn't it possible to make this a compiler error? Or maybe this is a form of a
halting-problem and can't be fixed? :)

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

Reply via email to