There is some strange code in Datasnap.DSReflect
unit
TDSAdapterClassType = type of TDSAdapterClass;
TDSAdapterClass = class(TPersistent)
pri
It seems to be related to PTypeInfo based in the TypeKind as you can write this:
program Project1;
{$APPTYPE CONSOLE}
uses
SysUtils;
type
TIntType = type of Integer;
TInt64Type = type of Int64;
var
intType: TIntType;
int64Type: TInt64Type;
begin
try
intType := Integer;
Assert(Pointer(intType) = TypeInfo(Integer));
intType := Cardinal;
Assert(Pointer(intType) = TypeInfo(Cardinal));
intType := NativeInt;
Assert(Pointer(intType) = TypeInfo(NativeInt));
int64Type := Int64;
Assert(Pointer(int64Type) = TypeInfo(Int64));
int64Type := UInt64;
Assert(Pointer(int64Type) = TypeInfo(UInt64));
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
Readln;
end.
But it does not work properly with all types and throws internal compiler errors for some.