[fpc-devel] Minor debate with ISO standard on case blocks

Sven Barth pascaldragon at googlemail.com
Tue Jul 30 14:04:08 CEST 2019


thaddy <thaddy at localhost> schrieb am Di., 30. Juli 2019, 10:04:

> On 2019-07-30 01:43, J. Gareth Moreton wrote:
> > As someone on the issue pointed out... on page 2, section 3.1:
> >
> > 3.1 Error
>
>
> I have added this to the bug report. Consider that here all possible
> case labels are implemented, the compiler still throws a compile time
> error.
> That means the implementation is wrong anyway.
>
> {$mode ISO}
> program isobug(infile,outfile);
> type
>    operator = (plus, minus, times);
> var
>    x:integer;
>    o:operator = plus;
> begin
>    x:=1;
>    case o of
>      plus : x := x;  // all
>      minus : x := x; // possible
>      times : x := x; // cases
>    end;
> end.
>
> The easy way out seems to revert to the 3.0.4 implementation given the
> section mentioned.
> Gareth's suggestion would be nice to have, though.


That's definitely a bug, cause the same code (with "operator" changed to
"op") compiles in mode ObjFPC without any warning or error.

Regards,
Sven

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20190730/288c5e1e/attachment.html>


More information about the fpc-devel mailing list