[fpc-devel] Minor debate with ISO standard on case blocks
thaddy
thaddy at localhost
Tue Jul 30 06:50:53 CEST 2019
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.
More information about the fpc-devel
mailing list