fpc/tests/webtbs/tw41066.pp
florian 553a1b968d * formatting
+ test for issue  which was already resolved previously
2024-12-23 16:11:03 +01:00

45 lines
702 B
ObjectPascal

program Project1;
{$mode objfpc}{$H+}
{$modeswitch prefixedattributes}
uses
Classes;
type
{ TMyAttribute }
TMyAttribute = class(TCustomAttribute)
constructor Create(AVal: Boolean);
private
FVal: Boolean;
published
property Val: Boolean read FVal;
end;
TMyObject = class
public
type
TFoobar = (fbOne, fbTwo);
[TMyAttribute(False)] // this works fine
TFoo = (fooOne, fooTwo);
public
type
[TMyAttribute(False)] // project1.lpr(30,7) Error: Syntax error, "identifier" expected but "[" found
TBar = (barOne, barTwo);
end;
{ TMyAttribute }
constructor TMyAttribute.Create(AVal: Boolean);
begin
FVal := AVal;
end;
begin
end.