fpc/tests/test/tcustomattr22.pp
svenbarth e97a2cb03e * tests with Delphi showed that an attribute class must explicitely declare a parameterless constructor if it should be used, cause TCustomAttribute.Create is private
Note: this also means that TCustomAttribute itself can not be used as an attribute
* adjusted existing tests
+ added test

git-svn-id: trunk@42471 -
2019-07-20 20:03:38 +00:00

25 lines
319 B
ObjectPascal

{ %FAIL }
program tcustomattr22;
{$mode objfpc}
{$modeswitch prefixedattributes}
type
TTestAttribute = class(TCustomAttribute)
constructor Create(aArg: LongInt);
end;
[TTestAttribute(42), TTestAttribute]
TMyTest = class
end;
constructor TTestAttribute.Create(aArg: LongInt);
begin
end;
begin
end.