fpc/tests/tbs/tb0514.pp
Jonas Maebe a15e5dc61c * always call tobject.create/free in MacPas mode for new/dispose constructs
(since macpas methods may accidentally be called like that as well,
     as it doesn't have any constructors/destructors)
  + some tests for MacPas objects from the GNU Pascal testsuite

git-svn-id: trunk@5421 -
2006-11-18 13:36:38 +00:00

30 lines
562 B
ObjectPascal

{ original: peter5d.pas from the GNU Pascal testsuite }
{$mode macpas}
program peter5d(output);
type
obj = object
procedure Destroy;
procedure Free;
end;
procedure obj.Destroy;
begin
dispose( self );
end;
procedure obj.Free;
begin
writeln('must not be called');
halt(1);
end;
var
o: obj;
begin
new(o);
o.Destroy;
WriteLn( 'OK' );
end.