Browse Source

* Delphi-compatible ToString for TRttiType. Patch from Lipinast Lekrisov

Michaël Van Canneyt 8 months ago
parent
commit
5a6b4ed8e4
1 changed files with 6 additions and 0 deletions
  1. 6 0
      packages/rtl-objpas/src/inc/rtti.pp

+ 6 - 0
packages/rtl-objpas/src/inc/rtti.pp

@@ -392,6 +392,7 @@ type
     function GetMethods: TRttiMethodArray; virtual; overload;
     function GetMethods(const aName: string): TRttiMethodArray; overload; virtual;
     function GetMethod(const aName: String): TRttiMethod; virtual;
+    function ToString : RTLString; override;
     property IsInstance: boolean read GetIsInstance;
     property IsManaged: boolean read GetIsManaged;
     property IsOrdinal: boolean read GetIsOrdinal;
@@ -7508,6 +7509,11 @@ begin
   Result := Nil;
 end;
 
+function TRttiType.ToString: RTLString;
+begin
+  Result:=Name;
+end;
+
 function TRttiType.GetMethods(const aName: string): TRttiMethodArray;
 var
   methods: specialize TArray<TRttiMethod>;