[Issue 8553] templated interface methods (virutal?) and linker missing symbols

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Aug 16 02:21:44 PDT 2012


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



--- Comment #1 from Kenji Hara <k.hara.pg at gmail.com> 2012-08-16 02:21:34 PDT ---
(In reply to comment #0)
> are currently templated virutal members supprted? Anyway ... it should not
> result in linker error.

Today, you can declare template function in interface, but it is treated as
final implicitly. Because template function cannot be virtual.

So, in the code

>    k.accept (new Visitor!int);

IKlazz.accept is always called instead of KlazzDeriv.accept, but its
implementation is not there, so linker error occurs.

Therefore, this is not a bug, but compiler should more better error message.
(I think compiler should enforce adding 'final' keyword to IKlazz.accept.)

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