Generics still have a lot of problems. I know they've been in the works for years but they still fail easily. Consider the Delphi mode below, I get "Error: Generics without specialization cannot be used as a type for a variable"
I could easily write up a whole bunch of test cases were generic still fail, both in Fpc and Delphi modes. If someone is considering working on the compiler to fix the problems with generics I can happily send them a bunch of test cases where the compiler currently fails.
{$mode delphi}{ TEnumerator<T> }
type
TEnumerator<T> = class abstract
protected
function DoGetCurrent: T; virtual; abstract;
function DoMoveNext: Boolean; virtual; abstract;
public
property Current: T read DoGetCurrent;
function MoveNext: Boolean;
end;{ TEnumerable<T> }
TEnumerable<T> = class abstract
protected
function DoGetEnumerator: TEnumerator<T>; virtual; abstract; // Error:
Generics without specialization cannot be used as a type for a variable
public
function GetEnumerator: TEnumerator<T>;
end;