tw13992.pp 484 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. { %fail }
  2. { new(property) should fail }
  3. program test_prop;
  4. {$mode delphi}
  5. type
  6. TMyRec = record
  7. s: string;
  8. end;
  9. PMyRec = ^TMyRec;
  10. TSomeClass = class
  11. private
  12. FMyRec: PMyRec;
  13. public
  14. constructor Create;
  15. destructor Destroy; override;
  16. property MyRec: PMyRec read FMyRec write FMyRec;
  17. end;
  18. { TSomeClass }
  19. constructor TSomeClass.Create;
  20. begin
  21. New(MyRec);
  22. end;
  23. destructor TSomeClass.Destroy;
  24. begin
  25. // Dispose(MyRec);
  26. inherited;
  27. end;
  28. begin
  29. end.