[fpc-devel] [] property overloads

Sven Barth pascaldragon at googlemail.com
Mon Jul 8 23:27:47 CEST 2019


Ryan Joseph <genericptr at gmail.com> schrieb am Mo., 8. Juli 2019, 18:04:

>
>
> > On Jul 8, 2019, at 11:07 AM, Sven Barth via fpc-devel <
> fpc-devel at lists.freepascal.org> wrote:
> >
> > As Pascal does not allow differentiating between result types this
> indeed needs to be/stay forbidden.
> >
>
> There actually is a need to distinguish between getters/setters but the
> way property syntax works we’re forced for the return type to be the same
> as the input for the setter. This is a problem I faced before where I want
> the getter to return a pointer but I want the setter to take a direct value.
>

Well, in theory you could use a read only index property that returns a
pointer and a write only index property that takes the type as is.
But overloading only based on the result type is not supported.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20190708/fb146b86/attachment.html>


More information about the fpc-devel mailing list