tclassattribute5.pp 447 B

123456789101112131415161718192021222324252627282930
  1. { %fail }
  2. program tclassattribute5;
  3. {$mode objfpc}{$H+}
  4. {$modeswitch prefixedattributes}
  5. uses
  6. typinfo;
  7. type
  8. { tmyt }
  9. tmyt = class(TCustomAttribute)
  10. private
  11. FID: integer;
  12. public
  13. constructor create(Id: integer);
  14. end;
  15. type
  16. // Delphi XE does compile attributes with invalid parameters.
  17. // That's clearly a Delphi-bug, so fpc should fail on the following:
  18. [Tmyt(924,32)]
  19. TMyObject = class(TObject)
  20. end;
  21. begin
  22. end.