fpc/tests/webtbf/tw3662.pp
2005-02-17 17:53:39 +00:00

37 lines
424 B
ObjectPascal

{ %fail }
{$ifdef fpc}{$MODE delphi}{$endif}
type
TA = class(TInterfacedObject)
public
constructor Create;
end;
TB = class(TA)
function Clone: TB;
end;
constructor TA.Create;
begin
inherited Create;
end;
function TB.Clone: TB;
var
b: TB;
begin
b := Create;
writeln(integer(b));
writeln(integer(self));
Result := b;
end;
var
aa,aa2: TB;
begin
aa := TB.Create;
aa2 := aa.Clone;
end.