tclassattribute7.pp 436 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. { %fail }
  2. program tclassattribute7;
  3. {$mode objfpc}{$H+}
  4. {$modeswitch prefixedattributes}
  5. uses
  6. typinfo;
  7. type
  8. { tmyt }
  9. TMyt = class(TCustomAttribute)
  10. constructor create;
  11. end;
  12. type
  13. { TMyObject }
  14. TMyObject = class(TObject)
  15. private
  16. FInt: integer;
  17. published
  18. // Should fail because there is nothing to bind the custom attribute to.
  19. [TMyt]
  20. end;
  21. constructor TMyt.create;
  22. begin
  23. //
  24. end;
  25. begin
  26. //
  27. end.