[fpc-devel] Allow record helper inheritance in Delphi mode

Ondrej Pokorny lazarus at kluug.net
Fri Sep 1 09:40:02 CEST 2017


On 01.09.2017 8:47, Stefan Glienke wrote:
> Inheritance seems like the obvious way but you just defer the "I 
> cannot extend the builtin helpers" problem.
> If any third party code decides to do so you are at the same point 
> again because now do you inherit from the third party helper or from 
> the builtin one?
> What if two third parties inherit from the helper?

Yes, you are right, I forgot about this issue.

> Therefor I argue that the "only the last one in scope is applied" 
> restriction should be removed.

This could be also solved by supporting "ancestor list" (what Delphi 
documentation talks about but the compiler doesn't allow it again):

   TEmbarcaderoHelper = class helper for TObject
   public
   end;

   TThirdPartyHelper = class helper for TObject
   public
   end;

   TMyHelper = class helper(TEmbarcaderoHelper, TThirdPartyHelper) for 
TObject
   public
   end;


Ondrej

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20170901/06cb6f0a/attachment.html>


More information about the fpc-devel mailing list