I get a compiler error message
[dcc32 Error] Unit1.pas(18): E2003 Undeclared identifier: 'TList<IInterface>'
in Delphi XE4 when I do this:
uses
Classes;
TMyClass = class
private
fIList : TList<IInterface>;
end;
Should I enable generics by a compiler option? Because when I remove the generic definition, it compiles. Other case it underline TList and IInterface as well.
You need to add the
System.Generics.Collections
unit to youruses
clause.This is where the
TList<T>
class is implemented, and the compiler will not find it unless you tell it where to look.