DelphiXE2 获取不到动态数组的RTTI信息,莫非是Delphi的Bug?
DelphiXE2 获取不到动态数组的RTTI信息,难道是Delphi的Bug??
type
TarrRec=TArray<TARecort>;
TTestClass=class(TInterfacedObject)
public
function TTest_Proxy.GetArr: TarrRec; // 这样写不能获得RTTI呢,
function TTest_Proxy.GetArr1: TArray<TARecort>; // 这样写就行,有没有人碰到过?
end;
T:=TRttiContext.Create.GetType(TTestClass);
method:=t.GetMethod('GetArr');
if Method.MethodKind=mkFunction then 取不到
------解决方案--------------------
TarrRec=TArray<TtestRecort>;好奇葩的写法,用D7的表示没见过
------解决方案--------------------
不用tarray,直接定义为 Array of TtestRecort
type
TarrRec=TArray<TARecort>;
TTestClass=class(TInterfacedObject)
public
function TTest_Proxy.GetArr: TarrRec; // 这样写不能获得RTTI呢,
function TTest_Proxy.GetArr1: TArray<TARecort>; // 这样写就行,有没有人碰到过?
end;
T:=TRttiContext.Create.GetType(TTestClass);
method:=t.GetMethod('GetArr');
if Method.MethodKind=mkFunction then 取不到
------解决方案--------------------
TarrRec=TArray<TtestRecort>;好奇葩的写法,用D7的表示没见过
------解决方案--------------------
不用tarray,直接定义为 Array of TtestRecort