unit ub0629; {$mode objfpc} {$modeswitch advancedrecords} interface uses typinfo; type TTest = record generic class function GetTypeInfo: PTypeInfo; static; end; implementation generic class function TTest.GetTypeInfo: PTypeInfo; begin Result := System.TypeInfo(T); end; end.