[Lazarus] Check if an abstract method is implemented or not

Xiangrong Fang xrfang at gmail.com
Thu Jan 24 14:41:40 CET 2013


One more report:

I finally decided to use the solution suggested by Fei, i.e. empty method
in base class instead of Abstract method. Becuase comparing address to
@system.AbstractError caused trouble if I put my class into a shared
library.

Thanks.



2013/1/24 Mattias Gaertner <nc-gaertnma at netcologne.de>

>
> Xiangrong Fang <xrfang at gmail.com> hat am 24. Januar 2013 um 14:03
> geschrieben:
>
> > This is a clean solution. And as a matter of fact, the compiler does NOT
> warn
> > me while instantiate class with abstract method.
>
> Normally the compiler warns for each abstract method. For example, this
> creates
> 5 warnings:
>  TStrings.Create;
> If not then please create a bug report.
>
>
> > This is different than Java, in which you must implement all abstract
> method
> > while inherits from an abstract class.
> >
> >  Why I shall not instantiate a sub-class that has not fully implemented
> > abstract methods of its parent class?
>
> Well, you can shoot yourself in the foot. ;)
>
> Mattias
>
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20130124/97cbb36e/attachment-0003.html>


More information about the Lazarus mailing list