tinline5.pp 515 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. {$inline on}
  2. {$mode objfpc}
  3. type
  4. tc = class
  5. lf: longint;
  6. procedure t(const l: longint); inline;
  7. end;
  8. var
  9. a: longint;
  10. procedure tc.t(const l: longint); inline;
  11. begin
  12. lf := 10;
  13. if (l <> 5) then
  14. begin
  15. writeln('error class');
  16. halt(1);
  17. end;
  18. end;
  19. procedure t(const l: longint); inline;
  20. begin
  21. a := 10;
  22. if (l <> 5) then
  23. begin
  24. writeln('error proc');
  25. halt(1);
  26. end;
  27. end;
  28. var
  29. c: tc;
  30. begin
  31. c := tc.create;
  32. c.lf := 5;
  33. c.t(c.lf);
  34. a := 5;
  35. t(a);
  36. end.