I use Delphi 10.3. It is a kind of routine to get the corresponding TRTTIType
for instance variables. But is there any way to fill the gap marked as * missing code * here:
function getGenericTypeName<T> : string;
var
ctx : TRTTIContext;
aRT : TRTTIType;
begin
ctx := TRTTIContext.Create;
try
aRT := *** missing code for T *** // Get the TRTTIType for type T
result := aRT.Name;
finally
ctx.Free;
end;
end;