[fpc-devel] [] property overloads

Ben Grasset operator97 at gmail.com
Tue Jul 9 18:09:15 CEST 2019


On Tue, Jul 9, 2019 at 9:39 AM Ryan Joseph <genericptr at gmail.com> wrote:

> Another thing regarding array properties. If I use constref on the setter
> I get an error "Illegal symbol for property access”. Is there any reason
> why the setter can’t be constref?
>

It works for constref if you use {$VARPROPSETTER ON}.

The docs for that directive are slightly incorrect, I just noticed, also:

https://www.freepascal.org/docs-html/current/prog/progsu121.html
Where it says "Enable use of var/out/const parameters for property
setters", it should say "Enable use of var/out/constref parameters for
property setters", because "const" is always allowed, and does not
*guarantee* by-reference passing the way "constref" does.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20190709/6c483a66/attachment.html>


More information about the fpc-devel mailing list