[fpc-pascal] How to have smaller units
Hairy Pixels
genericptr at gmail.com
Sat Nov 29 14:50:58 CET 2025
On Nov 29, 2025 at 8:40:33 PM, Thomas Kurz via fpc-pascal <
fpc-pascal at lists.freepascal.org> wrote:
> Can't you use a type helper to access the fields only locally in other
> classes? Unfortunately this works only for `protected` and not for
> `private` fields, but if it's your own class, maybe you'd like to give it a
> try.
>
> Btw: I would be great if type helpers could be given access to `private`
> fields, too!
>
>
Pretty sure no because the fields are private which is scoped to a single
file so if you declare the type helper in another unit you can't access the
field. That would be annoying to make helpers for all the types too.
I just tried actually and a property which read a public field from a class
in another unit failed too. That seems like a bug to me.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20251129/d99644fa/attachment.htm>
More information about the fpc-pascal
mailing list