Thread overview | |||||
---|---|---|---|---|---|
|
October 13, 2009 [Issue 3393] New: illegal to refer to 'this' implicitly or explicitly | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=3393 Summary: illegal to refer to 'this' implicitly or explicitly Product: D Version: 2.032 Platform: x86 URL: http://www.digitalmars.com/d/2.0/class.html#Constructo r OS/Version: Windows Status: NEW Keywords: accepts-invalid, spec Severity: normal Priority: P2 Component: DMD AssignedTo: nobody@puremagic.com ReportedBy: dfj1esp02@sneakemail.com --- Comment #0 from Sobirari Muhomori <dfj1esp02@sneakemail.com> 2009-10-13 07:44:56 PDT --- Spec reads: 3. It is illegal to refer to this implicitly or explicitly prior to making a constructor call. Although it's allowed. --- class A { int a; this(){ M(); this(1); } this(int b){ a=b; } void M(){ writeln("A.M"); } } class B:A { int b; this(){ M(); super(); b=5; } override void M(){ writeln("B.M ",b); } } int main() { auto b=new B(); b.M(); return 0; } --- output is --- B.M 0 B.M 0 B.M 5 --- We see how virtual method is called prior to constructor calls and overridden method from derived class is called from the constructor of the base class (called on not yet constructed object). -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
October 16, 2010 [Issue 3393] illegal to refer to 'this' implicitly or explicitly | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sobirari Muhomori | http://d.puremagic.com/issues/show_bug.cgi?id=3393 nfxjfg@gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nfxjfg@gmail.com Version|2.032 |D1 & D2 --- Comment #1 from nfxjfg@gmail.com 2010-10-16 12:44:26 PDT --- Same problem with D1. Also see bug 5056. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
January 23, 2012 [Issue 3393] illegal to refer to 'this' implicitly or explicitly | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sobirari Muhomori | http://d.puremagic.com/issues/show_bug.cgi?id=3393 Walter Bright <bugzilla@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|spec | CC| |bugzilla@digitalmars.com --- Comment #2 from Walter Bright <bugzilla@digitalmars.com> 2012-01-23 01:31:18 PST --- Compiler bug, not a spec issue. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation