Bug 1909 – final classes' methods that don't override anything shouldn't be virtual
Status
RESOLVED
Resolution
DUPLICATE
Severity
minor
Priority
P3
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2008-03-11T19:48:00Z
Last change time
2014-02-24T15:33:53Z
Keywords
performance
Assigned to
nobody
Creator
dlang-bugzilla
Comments
Comment #0 by dlang-bugzilla — 2008-03-11T19:48:03Z
test case:
final class C
{
void m()
{
}
}
void main()
{
(new C).m;
}
Examining the generated code shows that m is a virtual function, and called using the class's Vtable. Needless to say, this is an unneeded slowdown.
Comment #1 by smjg — 2009-09-18T04:06:36Z
This should also apply to methods that are declared final, whether in a final class or not. What happens here at the moment?
Comment #2 by matti.niemenmaa+dbugzilla — 2009-09-18T06:12:59Z
Looks like I managed to report a duplicate of this, #2326, which then got fixed in 1.037.
*** This issue has been marked as a duplicate of issue 2326 ***