[fpc-pascal] fcl-passrc errors

Sven Barth pascaldragon at googlemail.com
Mon Oct 14 14:02:44 CEST 2019


Mattias Gaertner via fpc-pascal <fpc-pascal at lists.freepascal.org> schrieb
am Mo., 14. Okt. 2019, 10:39:

> On Mon, 14 Oct 2019 07:37:38 +0200
> Sven Barth via fpc-pascal <fpc-pascal at lists.freepascal.org> wrote:
>
> >[...]
> > Because the iterator returns a Pointer and not whatever you think it
> > might return. If you know it's something else, you cast that inside
> > the loop.
>
> I agree with Sven.
>
> What about the other way round?
>
> For example this is allowed: TControl(aButton):=aControl;
> This works also when passing something to a "var" argument.
>
> It would be consistent to allow it as the for-in-loop variable.
>

First you agree with me and then you provide in essence the same examples
as Ryan? So what is it now?

Anyway as I wrote to Ryan: the for-in loop is defined as "for VAR in EXPR
do", not "for EXPR1 in EXPR2 do". And even if we would limit it to
typecasts then the next one would come and ask for this or that to be
allowed as well.

No. Nothing of that. There is a variable in the for-in-loop and nothing
more. Anything else currently is a bug and *will* break.

Regards,
Sven

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20191014/438a92bd/attachment.html>


More information about the fpc-pascal mailing list