fpc/tests/webtbs/uw29245.pp
Jonas Maebe cb7730a423 * fixed execution order of implicit finalization and class destructors: first
the latter, then the former

git-svn-id: trunk@38716 -
2018-04-08 15:41:00 +00:00

42 lines
600 B
ObjectPascal

unit uw29245;
{$mode delphi}
interface
type
TFoo = class
class var
F: array of TObject;
private
class constructor Create;
class destructor Destroy;
end;
implementation
class constructor TFoo.Create;
begin
writeln('tfoo class constructor');
SetLength(F, 10);
end;
class destructor TFoo.Destroy;
begin
writeln('tfoo class destructor');
if length(TFOO.F)<>10 then
halt(3);
end;
initialization
writeln('unit initialization');
if length(TFOO.F)<>10 then
halt(1);
finalization
writeln('unit finalization');
if length(TFOO.F)<>10 then
halt(2);
end.