@@ -0,0 +1,38 @@
+type
+ to1 = class
+ constructor create;
+ procedure afterconstruction;override;
+ end;
+
+var
+ i : longint;
+ constructor to1.create;
+ begin
+ inherited create;
+ if i<>1000 then
+ halt(1);
+ i:=2000;
+ procedure to1.afterconstruction;
+ if i<>2000 then
+ i:=3000;
+ o1 : to1;
+begin
+ i:=1000;
+ o1:=to1.create;
+ if i<>3000 then
+ o1.destroy;
+ writeln('ok');
+end.
+ destructor destroy;override;
+ procedure beforedestruction;override;
+ destructor to1.destroy;
+ inherited destroy;
+ procedure to1.beforedestruction;