Thread overview |
---|
April 19, 2008 [Issue 2015] New: Virtual template methods are allowed | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=2015 Summary: Virtual template methods are allowed Product: D Version: 1.028 Platform: All OS/Version: All Status: NEW Keywords: accepts-invalid Severity: normal Priority: P2 Component: DMD AssignedTo: bugzilla@digitalmars.com ReportedBy: dvdfrdmn@users.sf.net 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. -- |
April 19, 2008 [Issue 2015] Virtual template methods are allowed | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=2015 kamm-removethis@incasoftware.de changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |DUPLICATE ------- Comment #1 from kamm-removethis@incasoftware.de 2008-04-19 14:30 ------- Maybe add the implementation hint to bug 566 as well. *** This bug has been marked as a duplicate of 566 *** -- |
April 19, 2008 [Issue 2015] Interface template methods are allowed | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=2015 dvdfrdmn@users.sf.net changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|DUPLICATE | Summary|Virtual template methods are|Interface template methods |allowed |are allowed ------- Comment #2 from dvdfrdmn@users.sf.net 2008-04-19 16:14 ------- 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)(); } --- -- |
April 19, 2008 [Issue 2015] Interface template methods are allowed | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=2015 dvdfrdmn@users.sf.net changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |RESOLVED Resolution| |DUPLICATE ------- Comment #3 from dvdfrdmn@users.sf.net 2008-04-19 16:17 ------- Oops, didn't realize 566 was still open. *** This bug has been marked as a duplicate of 566 *** -- |
Copyright © 1999-2021 by the D Language Foundation