PATCH make the case statement in ISO mode behave like extendedpascal mode ( no compile time, but run-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 ISO mode there is a bug that throws a compile time error even if all case labels are satisfied.
This patch solves this issue in so far that it now follows the same code path as extended pascal.
It still issues a - factually incorrect - warning, but it behaves now like:
- warning that not all case labels are setisfied
- Issues a run-time error if the case entry is outside of the range
- accepts missing labels within the valid range
It is in my opinion also more correct in light of ISO7185:1990 6.8.3.5 Case-statements
Solves problems with a lot of existing code.
Steps to reproduce:
e.g:
{$mode iso}
program isobug(infile,outfile);
type
operator = 3..5;
var
x:integer;
o:operator = 5;
begin
x:=1;
case o of
3 : x := x;
4 : x := x;
5 : x := x;
end;
end.
Additional information:
Patch for the test cases will follow separately.
Mantis conversion info:
- Mantis ID: 35910
- OS: all
- OS Build: all
- Build: 42526
- Platform: all
- Version: 3.3.1
- Fixed in version: 3.3.1
- Fixed in revision: 42574 (#46afcbb3)
- Monitored by: » @KaiBurghardt (Kai Burghardt), » Thaddy (Thaddy de Koning)