summaryrefslogtreecommitdiff
path: root/tests/webtbs/tw11861.pp
blob: ca91d007f13cf30b04502b1f771600fa77f133ca (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
{$ifdef fpc}
{$mode delphi}
{$endif}

type

  { TMyObj }

  TMyObj = class
    procedure Proc(A1 : TObject; A2: Integer);
  end;

type
   TProc = procedure(AObject : TObject; A2: Integer) of object;

  
var X: TMyObj;
    P1: TProc;

procedure foo(const AMethod1);
begin
  if pointer(AMethod1) <> pointer(@P1) then
    halt(1);
end;

   
{ TMyObj }

procedure TMyObj.Proc(A1 : TObject; A2: Integer);
begin
end;


begin
  X := TMyObj.Create;
  P1 := X.Proc;
  foo(P1);
end.