summaryrefslogtreecommitdiff
path: root/fpcsrc/tests/webtbs/tw2669.pp
blob: f11bb1303964af77fd22cb44533b476a776471f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
{ %version=1.1 }
{ Source provided for Free Pascal Bug Report 2669 }
{ Submitted by "marco" on  2003-09-06 }
{ e-mail: marco+web@freepascal.org }

{$mode Delphi}
Type
   TPop3NextProc = procedure of object;
   t1= class
            procedure server; virtual;
            procedure run; virtual;
            procedure connect; virtual;
   end;

   t2=class
         f1 : t1;
         procedure exec(p:TPop3NextProc);
         procedure callexec;
         constructor create;
         end;


procedure t1.server;

begin
 writeln('server');
end;

procedure t1.run;

begin
 writeln('run');
end;


procedure t1.connect;

begin
 writeln('connect');
end;


constructor t2.create;

begin
  inherited create;
  f1:=t1.create;
end;

procedure t2.exec(p:TPop3NextProc);

begin
 writeln('in exec');
 p;
end;

procedure t2.callexec;

begin
 writeln('callexec');
 exec(f1.server);
 exec(f1.run);
 exec(f1.connect);
end;


var c1 : t2;

begin
  writeln('start');
  c1:=t2.create;
  writeln('after create');
  c1.callexec;
  writeln('end');
end.