summaryrefslogtreecommitdiff
path: root/tests/webtbs/tw0870.pp
blob: ee7348f457282f45aa4845dea73e6fce38861598 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{$mode objfpc}
uses sysUtils;

 type
      t = object
       f:integer;
       function m: AnsiString;
      end;

 function t.m: AnsiString;
 begin
  result:=IntToStr(f);
 end;

 var ti:t;

begin
 ti.f:=1; // no vmt for t - constructor call is not needed
 writeln(format('%s', [ti.m])); // this works
 writeln(format('%s, %s', [ti.m, ti.m])); // this does not - the same story with classes
end.