tw15727b.pp 529 B

12345678910111213141516171819202122232425
  1. { %fail }
  2. {$mode objfpc}
  3. {$r+}
  4. uses
  5. SysUtils;
  6. procedure test(a: array of const);
  7. begin
  8. if (a[0].vtype<>vtinteger) or
  9. (a[0].vinteger<>longint($f0f0f0f0)) then
  10. halt(1);
  11. end;
  12. var
  13. z: cardinal;
  14. begin
  15. // next line produces compilation error "Error: range check error while evaluating constants"
  16. // accepted now in Delphi mode, not in FPC mode because this value is
  17. // implicitly converted to a longint, and $f0f0f0f0 is an invalid longint
  18. // value (use longint($f0f0f0f0) instead)
  19. test([$F0F0F0F0]);
  20. end.