Am 04.04.2021 um 20:15 schrieb Ryan Joseph via fpc-pascal:

On Apr 4, 2021, at 12:10 PM, Sven Barth via fpc-pascal 
<fpc-pascal@lists.freepascal.org> wrote:

FieldAddress only works on published fields. Just like MethodAddress only works 
on published methods.

For private fields extended RTTI is required which is not yet implemented.
I don't understand this at all I guess. I thought the properties made them published and 
I get a "Symbol cannot be published, can be only a class" if I put the field 
itself in the published section.

Just trying to do this:

PInteger(theClass.FieldAddress('foo'))^ := 10;

Only classes or interfaces are supported as published *fields*.

And the visibility of the *property* does not change the visibility of the *field*, after all the property could be provided by a method.

Regards,
Sven
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to