Am 11.11.2011 13:29, schrieb Vladimir Panteleev:
On Fri, 11 Nov 2011 04:12:43 +0200, Walter Bright
<newshou...@digitalmars.com> wrote:
On 11/10/2011 5:10 PM, Nick Sabalausky wrote:
Isn't this a bug that the compiler accepted it and the error didn't get
raised until it got all the way to the linker? Doesn't the compiler
normally
catch that before it gets to the linker?
No. The reason is the implementation may be in another .obj file known
only to the linker.
I can't see how that makes sense, even with the above (un-idiomatic?)
idea. The compiler should not emit references to *abstract* methods.
I think this looks like a case of class attributes not affecting
methods: "Address" is declared as an abstract class, but the compiler
doesn't realize that its methods are abstract too. They are simply
declared as method declarations without a body.
This is similar to another old bug (now fixed, I believe), when methods
of "final" classes were still implicitly virtual.
So, according to all the answers here, i simply have to implement all
methods from Address then? Ok, so if thats the point im fine with it.
I just thought (as it is in Java and PHP), that methods in abstract
classes need to have a body too. If an extending class isn“t
implementing those, theyll simply get copied.