[Issue 5056] Warning against virtual method call from constructor
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Nov 21 19:08:45 PST 2010
http://d.puremagic.com/issues/show_bug.cgi?id=5056
Witold Baryluk <baryluk at smp.if.uj.edu.pl> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |baryluk at smp.if.uj.edu.pl
--- Comment #10 from Witold Baryluk <baryluk at smp.if.uj.edu.pl> 2010-11-21 19:07:23 PST ---
> > This confuses me. It works both in D1 and D2. Maybe it's a regression?
> > The spec says:
> >
> > "3. It is illegal to refer to this implicitly or explicitly prior to making a
> > constructor call."
> > http://www.digitalmars.com/d/1.0/class.html#constructors
>
> I interpret that the same way you do. I think maybe that this is a rule that
> was removed, but someone forgot to remove it from the docs? I think you should
> file a separate doc bug on it.
>
> It doesn't strike me as a good requirement anyways. What problems does having
> that restriction prevent?
Hmm. I was using this "feature", setting fields before calling super(), for
VERY long time. It worked, so i never actually payed attention, if i call
super() at the beginning or the end of constructor - both worked well.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list