[fpc-pascal] += property bug?
Sven Barth
pascaldragon at googlemail.com
Wed Aug 14 20:12:03 CEST 2019
Michael Van Canneyt <michael at freepascal.org> schrieb am Mi., 14. Aug. 2019,
18:24:
> Basically any operation that requires an address is not allowed.
> That += is using an address is an implementation detail of the compiler.
> Same as Inc() or In/Exclude(). I don't know the exact reason for this
> limitation,
> but it's bound to be a good one, otherwise it would have been lifted a
> long time
> ago...
>
The restriction regarding taking an address was only started to be enforced
in 2.4.0 (see
https://wiki.freepascal.org/User_Changes_2.4.0#Treating_direct-mapped_properties_as_regular_fields)
and further extended to records in 2.6.0 (see
https://wiki.freepascal.org/User_Changes_2.6.0#Taking_the_address_of_fields_of_record_properties
). The idea is to have properties backed by a field and backed by methods
behave identically.
Regards,
Sven
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20190814/997b29c4/attachment.html>
More information about the fpc-pascal
mailing list