tw13135.pp 221 B

12345678910111213141516171819202122
  1. { %fail }
  2. {$mode objfpc}
  3. type
  4. ta = class
  5. end;
  6. tb = class(ta)
  7. end;
  8. procedure test(var a: ta);
  9. begin
  10. a.free;
  11. a:=ta.create;
  12. // now b contains an instance of type "ta"
  13. end;
  14. var
  15. b: tb;
  16. begin
  17. test(b);
  18. end.