[fpc-pascal] modeswitch multihelpers precedence problem

Mattias Gaertner nc-gaertnma at netcologne.de
Tue Mar 10 09:50:06 CET 2020


On Tue, 10 Mar 2020 08:11:21 +0100 (CET)
Michael Van Canneyt <michael at freepascal.org> wrote:

>[...]
> I'm inclined to think you found the reason why Embarcadero disallows
> type helpers.

That would imply E thought type helpers through. I doubt that, e.g.
write access to read only properties.

 
> A type helper extends a type with some additional methods. Since the
> sysutils unit comes first in the uses clause, it is the first to
> extend the string type. Then comes the myunit helper, which tries to
> extend the same type with the same methods. The compiler sees the
> first attached method.

In Delphi the type helper of the last unit wins. So I would expect the
same for multi type helpers.

Mattias


More information about the fpc-pascal mailing list