* new bug

This commit is contained in:
peter 2002-05-10 07:51:54 +00:00
parent 09ccea65cb
commit 895b7c6840
2 changed files with 52 additions and 0 deletions

34
tests/webtbf/tw1949.pp Normal file
View File

@ -0,0 +1,34 @@
{ %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.

18
tests/webtbs/tw1950.pp Normal file
View File

@ -0,0 +1,18 @@
{$ifdef fpc}{$mode delphi}{$endif}
uses SysUtils;
type TTest = record
a, b: integer;
end;
procedure Test(const T: TTest);
begin
if @T = nil then exit;
// do something
end;
begin
Test(TTest(nil^)); {case 1}
Test(TTest(Pointer(nil)^)); {case 2}
end.