In mode extendedpascal a run-time error is thrown on a case statement with a literal selector, should be compile-time error.
Original Reporter info from Mantis: Thaddy
-
Reporter name: Thaddy de Koning
Original Reporter info from Mantis: Thaddy
- Reporter name: Thaddy de Koning
Description:
In mode extendedpascal a run-time error is thrown on a literal selector that has no label, but should throw a compile time error since the literal is resolved at compile time.
Steps to reproduce:
This should throw compile time error and not a run-time error:
{$mode extendedpascal}
program iso10206bug(infile,outfile);
type
operator = 3..5;
var
x:integer;
o:operator = 4;
begin
x:=1;
case o of
3 : x := x;
5 : x := x;
end;
end.
Whereas this should throws a correct run-time error:
{$mode extendedpascal}
program iso10206bug2(infile,outfile);
type
operator = 3..5;
procedure testme(const o:operator);
var
x:integer;
begin
x:=1;
case o of
3 : x := x;
5 : x := x;
end;
end;
begin
Testme(4);
end.
The latter is correct: error 201
Additional information:
Discovered during researching case bug in iso mode, but this is in $extendedpascal mode
Mantis conversion info:
- Mantis ID: 35915
- Build: 42543
- Version: 3.3.1
- Fixed in version: 3.3.1
- Fixed in revision: 42574 (#46afcbb3)