Compiler allows the following:
--
class X
{
void f(T)() { }
}
void main() { (new X).f!(int)(); }
--
This is due (at least partially) to the use of toParent() instead of toParent2() to in FuncDeclaration::semantic, FuncDeclaration::isVirtual, and Dsymbol::isMember.
Comment #1 by kamm-removethis — 2008-04-19T14:30:48Z
Maybe add the implementation hint to bug 566 as well.
*** This bug has been marked as a duplicate of 566 ***
Comment #2 by dvdfrdmn — 2008-04-19T16:14:00Z
This actually came from a SourceForge bug report. The original specifies interface methods. In this case, the code fails to link, but there should be a proper error message.
----
interface TestInterface
{ void tpl(T)(); }
class TestImplementation : TestInterface
{ void tpl(T)() { } }
void main()
{
/* TestImplementation t = new TestImplementation(); // works */
TestInterface t = new TestImplementation(); // fails
t.tpl!(int)();
}
---
Comment #3 by dvdfrdmn — 2008-04-19T16:17:11Z
Oops, didn't realize 566 was still open.
*** This bug has been marked as a duplicate of 566 ***