2
0

tw7975.pp 430 B

12345678910111213141516171819202122232425262728293031
  1. {$mode objfpc}
  2. {$inline on}
  3. unit tw7975;
  4. interface
  5. type
  6. tc = class
  7. function t(const s: string): string; virtual;
  8. pref: string;
  9. parent: tc;
  10. end;
  11. function test(c: tc): string; inline;
  12. implementation
  13. function tc.t(const s: string): string;
  14. begin
  15. result := s + ' -- passed t';
  16. end;
  17. function test(c: tc): string; inline;
  18. begin
  19. c.pref := 'bla';
  20. c.parent := c;
  21. result := c.parent.t('a'+c.pref);
  22. end;
  23. end.