[Issue 5056] Warning against virtual method call from constructor

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Oct 16 12:09:48 PDT 2010


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



--- Comment #7 from Steven Schveighoffer <schveiguy at yahoo.com> 2010-10-16 12:09:12 PDT ---
(In reply to comment #6)
> (In reply to comment #5)
> > Hm... I just tried it, it does work.  Were you thinking of something else?
> 
> 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?

> And I thought past versions of dmd conform to this, but apparently I'm wrong.

BTW, the file compiled with the oldest compiler I had installed (2.033).  So it
certainly has been this way for some time.  I expect at some point it was as
the docs state or else why would that rule even be there?

-- 
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