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

Ondrej Pokorny lazarus at kluug.net
Fri Sep 1 12:02:49 CEST 2017


On 01.09.2017 11:41, Stefan Glienke wrote:
> Again you will cause unnecessary headaches because now your helper has the dependency of the builtin and the third party one.

Not really, if you want to use both helpers (builtin and 3rd party) in 
the same unit you have the dependencies already added.

> How would third party one and third party two implement them? They both probably would extend the builtin one. Which one can you use in your code then?

I define TMyHelper with the ancestors I want to have available. It has 
the plus that I also can disable helpers that I don't want to use but 
that are available through unit dependencies.

> Yes, the one that comes last in the uses. What if you want to use functions from both? Out of luck again.

No, TMyHelper has all methods available both from both 
TEmbarcaderoHelper and TThirdPartyHelper, I can also have something like:

TMyHelper = class helper (THelper3rdParty1, THelper3rdParty2)

+++

But yes I fully agree with you. It's much easier when the "only the last 
one in scope is applied" restriction is removed. It was just an idea how 
to make it using the current Delphi documentation.

Ondrej



More information about the fpc-devel mailing list