Bug 1289 – Class method without a function body should be abstract?
Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
Other
OS
Linux
Creation time
2007-06-24T06:58:00Z
Last change time
2014-02-16T15:25:31Z
Assigned to
bugzilla
Creator
onlystupidspamhere
Comments
Comment #0 by onlystupidspamhere — 2007-06-24T06:58:54Z
The spec should state whether a method without a body is abstract or not. Of course this also affects the behavior of compiler. For instance this fails when linking:
class A { A f(); }
class B : A { B f() { return this; } }
void main() { B a = new B(); }
In some occasions similar code works, in others it doesn't.
Comment #1 by bugzilla — 2007-06-28T15:13:36Z
This is working as designed. It allows one to implement a member function elsewhere than the class definition. To have an abstract class, it must have the 'abstract' storage class.