I wish we could use TypeInfo(T) in compiler directives inside of generics...

{$IF TypeInfo(T).Kind = tkInterface}
  some interface specific source
{$ELSEIF TypeInfo(T).Kind = tkClass}
  some objects specific source
  everything else

That way we could at least achieve some kind of folding without that insane code duplication that comes with the use of generics.

Btw #Spring4D 1.0 will have a switch to enable folding for lists that contain objects or interfaces to achieve something that is similar to what the C# compiler does with generics for reference types.
Shared publiclyView activity