ivarol130.pp 808 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. {$ifndef bigfile}
  2. {$ifdef fpc}
  3. {$mode delphi}
  4. {$else fpc}
  5. {$define FPC_HAS_TYPE_EXTENDED}
  6. {$endif fpc}
  7. {$endif bigfile}
  8. type
  9. {$ifdef FPC_COMP_IS_INT64}
  10. comp130 = currency;
  11. {$else FPC_COMP_IS_INT64}
  12. comp130 = comp;
  13. {$endif FPC_COMP_IS_INT64}
  14. procedure test130(a: shortint); overload;
  15. begin
  16. writeln('shortint called instead of double');
  17. end;
  18. procedure test130(a: double); overload;
  19. begin
  20. writeln('double called instead of shortint');
  21. halt(1)
  22. end;
  23. var
  24. x130: shortint;
  25. y130: double;
  26. procedure dotest130;
  27. var
  28. v: variant;
  29. begin
  30. try
  31. v := x130;
  32. test130(v);
  33. except
  34. on E : TObject do
  35. halt(1);
  36. end;
  37. try
  38. v := y130;
  39. test130(v);
  40. except
  41. on E : TObject do
  42. halt(1);
  43. end;
  44. end;
  45. {$ifndef bigfile} begin
  46. dotest130;
  47. end. {$endif not bigfile}