[fpc-pascal] Type used to specialize a generic

Joao Morais l at joaomorais.com.br
Sun Nov 23 18:03:55 CET 2014


Hello list, is there a safe way to know the PTypeInfo, or at least the 
string literal of the type(s) used to specialize a generic? Eg:

     TBarList = specialize TGenericList<TBar>

On the sample above, starting with PTypeInfo of TBarList I know it was 
specialized using TBar type. I was using the following hack on 2.6.x:

     VPos := Pos('$', AClassName);
     if VPos > 0 then
       VTypeName := Copy(AClassName, VPos + 1, Length(AClassName));

...which is broken on 2.7.

Joao Morais




More information about the fpc-pascal mailing list