我正在使用Delphi 10.2 Tokyo,并且遇到以下情况:
假设我具有以下过程,以验证对象的属性:
procedure TGenericUnit.VerifyProps<T>(_AObj: T);
var
AContext: TRttiContext;
AType: TRttiType;
AProp: TRttiProperty;
begin
AType := AContext.GetType(T);
for AProp in AType.GetProperties do
if AProp.PropertyType is TObject then
// VerifyProps<?>(?);
end;
Run Code Online (Sandbox Code Playgroud)
如果我不知道它将是哪种类型的对象,并且不一定与T相同,该如何递归调用此过程?