tw29372.pp 844 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. program tw29372;
  2. {$MODE DELPHI}
  3. type
  4. TR1 = record
  5. A, B, C: Int64;
  6. constructor Create(_A, _B, _C: Int64);
  7. end;
  8. TR2 = record
  9. D, E, F: Int64;
  10. constructor Create(_D, _E, _F: Int64);
  11. end;
  12. constructor TR1.Create(_A, _B, _C: Int64);
  13. begin
  14. A := _A;
  15. B := _B;
  16. C := _C;
  17. end;
  18. constructor TR2.Create(_D, _E, _F: Int64);
  19. begin
  20. D := _D;
  21. E := _E;
  22. F := _F;
  23. end;
  24. { Note: unlike in the file attached at #29372 we use "const" both times to
  25. trigger the error on x86_64 as well }
  26. procedure Foo(const _1: TR1; const _2: TR2);
  27. begin
  28. if _1.A <> 1 then
  29. Halt(1);
  30. if _1.B <> 2 then
  31. Halt(2);
  32. if _1.C <> 3 then
  33. Halt(3);
  34. if _2.D <> 4 then
  35. Halt(2);
  36. if _2.E <> 5 then
  37. Halt(5);
  38. if _2.F <> 6 then
  39. Halt(6);
  40. end;
  41. begin
  42. Foo(TR1.Create(1, 2, 3), TR2.Create(4,5,6));
  43. end.