Browse Source

* Attributes for methods

Michaël Van Canneyt 1 year ago
parent
commit
91756b9e3e
1 changed files with 11 additions and 1 deletions
  1. 11 1
      packages/rtl-objpas/src/inc/rtti.pp

+ 11 - 1
packages/rtl-objpas/src/inc/rtti.pp

@@ -1893,9 +1893,19 @@ begin
 end;
 
 procedure TRttiInstanceMethod.ResolveAttributes;
+
+var
+  tbl : PAttributeTable;
+  i : Integer;
+
 begin
   FAttributesResolved:=True;
-  // Todo !!
+  tbl:=FHandle^.AttributeTable;
+  if not (assigned(Tbl) and (Tbl^.AttributeCount>0)) then
+    exit;
+  SetLength(FAttributes,Tbl^.AttributeCount);
+  For I:=0 to Length(FAttributes)-1 do
+    FAttributes[I]:={$IFDEF FPC_DOTTEDUNITS}System.{$ENDIF}TypInfo.GetAttribute(Tbl,I);
 end;
 
 function TRttiInstanceMethod.GetParameters(aWithHidden: Boolean): TRttiParameterArray;