summaryrefslogtreecommitdiff
path: root/classattributes/tests/test/tclassattribute8.pp
blob: 1c87949f9b95aad4ca56c19bf15b83f6d9321430 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{ %fail }
program tclassattribute8;

{$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.