http://d.puremagic.com/issues/show_bug.cgi?id=3790
Summary: [OOP] constructor of child class cannot pass arguments into parent constructor Product: D Version: 2.041 Platform: x86_64 OS/Version: Linux Status: NEW Severity: blocker Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: denis.tomi...@gmail.com --- Comment #0 from iorlas <denis.tomi...@gmail.com> 2010-02-09 18:16:32 PST --- Constructor of child class cannot pass arguments into parent constructor. See the example: class A{ final this(int a=0){ writeln(a); } } class B:A{ } B b = new B(); //prints 0 B b2 = new B(2); //throws an error "expected 0 arguments, not 1..." As we can see, logic is normal, but not in dmd. This bug creates a new bug: class A{ final this(int a=0){ writeln(a); } } class B:A{ this(int a=0){ //compiler perfectly, but parent constructor marked as "final" super(a); } } It might be not a hard problem, but it will be good for my project to create a logical, nice-look code. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------