mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-05 12:18:30 +02:00
35 lines
507 B
ObjectPascal
35 lines
507 B
ObjectPascal
{ %fail }
|
|
|
|
{$mode objfpc}{$H+}
|
|
|
|
type
|
|
TMyProc = procedure;
|
|
|
|
TMyClassA = class
|
|
private
|
|
FOnMyEvent: TMyProc;
|
|
public
|
|
property OnMyEvent: TMyProc read FOnMyEvent write FOnMyEvent;
|
|
end;
|
|
|
|
TMyClassB = class
|
|
public
|
|
MyClassA: TMyClassA;
|
|
procedure DoIt;
|
|
constructor Create;
|
|
end;
|
|
|
|
procedure TMyClassB.DoIt;
|
|
begin
|
|
|
|
end;
|
|
|
|
constructor TMyClassB.Create;
|
|
begin
|
|
MyClassA:=TMyClassA.Create;
|
|
MyClassA.OnMyEvent:=@DoIt; // DoIt is 'procedure of object' -> incompatible !
|
|
end;
|
|
|
|
begin
|
|
end.
|