2
0

tbug870.pp 395 B

123456789101112131415161718192021
  1. {$mode objfpc}
  2. uses sysUtils;
  3. type
  4. t = object
  5. f:integer;
  6. function m: AnsiString;
  7. end;
  8. function t.m: AnsiString;
  9. begin
  10. result:=IntToStr(f);
  11. end;
  12. var ti:t;
  13. begin
  14. ti.f:=1; // no vmt for t - constructor call is not needed
  15. writeln(format('%s', [ti.m])); // this works
  16. writeln(format('%s, %s', [ti.m, ti.m])); // this does not - the same story with classes
  17. end.