tb0140.pp 389 B

12345678910111213141516171819202122
  1. { Old file: tbs0165.pp }
  2. { missing range check code for enumerated types. OK 0.99.9 (PFV) }
  3. {$R+}
  4. Program bug0165;
  5. uses
  6. erroru;
  7. { No range check when -Cr given}
  8. Type Directions = (North, East,South,West);
  9. Var Go : Directions;
  10. begin
  11. Require_Error(201);
  12. Go:=North;
  13. Go:=Pred(Go); { must give run-time error }
  14. Go:=Pred(North); { must give compile time error }
  15. end.