[fpc-pascal] Check In Interface Type Helpers
Sven Barth
pascaldragon at googlemail.com
Wed Aug 23 17:15:56 CEST 2017
Am 23.08.2017 16:01 schrieb "Anthony Walter" <sysrpl at gmail.com>:
>
> Marco, it doesn't work that way.
>
> Type helpers simply allow you to extend an existing type with new methods
and/or properties. When you declare a type helper you extend all instances
of said type given that:
>
> A) You 'use' the unit declaring the type helper in some other unit.
> B) No other unit you're using also defines a type helper for that same
type. Only one type helper per type allowed.
>
To be more precise: the last helper in scope simply wins. There is no error
if multiple ones are in scope. Also one can cheat a bit by having one's own
helper inherit from another helper of the same type ;)
Though I should mention that it's on my list to implement support for
multiple helpers. I just need to be sure about the resolution rules :)
Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20170823/14e89cf1/attachment.html>
More information about the fpc-pascal
mailing list