Browse Source

* Allow attributes on sub types. Fixes issue #40997

Michaël Van Canneyt 9 months ago
parent
commit
091189a40c
1 changed files with 10 additions and 3 deletions
  1. 10 3
      compiler/pdecobj.pas

+ 10 - 3
compiler/pdecobj.pas

@@ -1205,9 +1205,16 @@ implementation
                   Message(parser_e_type_var_const_only_in_records_and_classes);
                 consume(_TYPE);
                 object_member_blocktype:=bt_type;
-                { expect at least one type declaration }
-                if token<>_ID then
-                  consume(_ID);
+
+                if (token=_LECKKLAMMER) and (m_prefixed_attributes in current_settings.modeswitches) then
+                begin
+                  check_unbound_attributes;
+                  types_dec(true,hadgeneric, rtti_attrs_def);
+                end
+                else
+                  // expect at least one type declaration
+                  if token<>_ID then
+                    consume(_ID);
               end;
             _VAR :
               begin