[Issue 13985] Wrong code when using "super" to call final interface method

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Apr 2 05:24:26 PDT 2015


https://issues.dlang.org/show_bug.cgi?id=13985

--- Comment #3 from Kenji Hara <k.hara.pg at gmail.com> ---
(In reply to Vladimir Panteleev from comment #2)
> The test is no longer reproducible after
> https://github.com/D-Programming-Language/dmd/pull/4427
> 
> But I don't know if this fixed the underlying problem.

It fixes this issue.

The original problem was: a final function call super.mf(); wrongly looked up
instance vtbl, and it would accidentally hit to Object.opCmp (it's in the third
entry of vtbl).

In D, there are three cases on a member function call which don't need to look
up vtbl.

1) this.BaseClassType.func();   // DotTypeExp
2) super.func();
3) this.func();   // func is a final function

Issue 14211 was an issue in the case 3, and this was an issue in the case 2.
I've properly handled all cases in that pull request.

--


More information about the Digitalmars-d-bugs mailing list