summaryrefslogtreecommitdiff
path: root/tests/webtbs/tw3499.pp
blob: 7e97ad483717a351ac7f4ea419b9e285067fafd5 (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
{ Source provided for Free Pascal Bug Report 3499 }
{ Submitted by "Bart Tierens" on  2005-01-02 }
{ e-mail: svg@deds.nl }
program test;

{$ifdef fpc}{$mode delphi}{$endif}

uses SysUtils;

var
  err : boolean;

type
  TProcedure = procedure of object;
  Class1 = class
  public
    proc: TProcedure;
    procedure p(const aproc: TProcedure);
  end;
  Class2 = class
  public
    procedure d();
  end;

procedure Class1.p(const aproc: TProcedure);
begin
  proc := aproc;
end;

procedure Class2.d();
begin
  writeLn('procedure called');
  err:=false;
end;

var
  c: Class1;
  e: Class2;
begin
  err:=true;
  c := Class1.create();
  e := Class2.create();
  c.p(e.d);
  c.proc;
  if err then
    halt(1);
end.