[fpc-pascal] type helpers
Sven Barth
pascaldragon at googlemail.com
Fri Jan 11 17:14:44 CET 2019
Am Fr., 11. Jan. 2019, 14:52 hat Mattias Gaertner via fpc-pascal <
fpc-pascal at lists.freepascal.org> geschrieben:
> On Fri, 11 Jan 2019 14:27:13 +0100
> Sven Barth via fpc-pascal <fpc-pascal at lists.freepascal.org> wrote:
>
> >[...]
> > This is by design. In this case DoIt is called on a temp variable
> > that gets its value from b.w, the value of b.FW does not change
>
> Ehm, in this case b.FW *does* changes.
> Maybe you mean the case
> property W: word read GetW;
> ?
>
> With a getter method indeed a temp variable is changed by the
> helper.
>
Dang it. Seems I've missed that part of your example. In my opinion it
should use a temp in that case.
> > (same
> > reason why the C operators do not work on properties). Same happens
> > with constants btw: Word(42).DoIt will work as well.
>
> Well, at least 3.DoIt is rejected.
>
"3" is not a Word ;)
Regards,
Sven
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20190111/f9905fc8/attachment.html>
More information about the fpc-pascal
mailing list