mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-08 19:08:07 +02:00
38 lines
462 B
ObjectPascal
38 lines
462 B
ObjectPascal
{ %fail }
|
|
program tcustomattr8;
|
|
|
|
{$mode objfpc}{$H+}
|
|
{$modeswitch prefixedattributes}
|
|
|
|
uses
|
|
typinfo;
|
|
|
|
type
|
|
|
|
{ tmyt }
|
|
|
|
TMyt = class(TCustomAttribute)
|
|
constructor create;
|
|
end;
|
|
|
|
type
|
|
|
|
{ TMyObject }
|
|
|
|
[TMyt]
|
|
TMyObject = class(TObject)
|
|
end;
|
|
// Attributes for integers are not allowed, so the following should fail, since
|
|
// there is nothing to bind the attribute to.
|
|
[TMyt]
|
|
int = integer;
|
|
|
|
constructor TMyt.create;
|
|
begin
|
|
|
|
end;
|
|
|
|
begin
|
|
end.
|
|
|