Delphi Compiler Error
E2574 Instantiated type can not be used for TYPE’d type declaration
Reason for the Error & Solution
This occurs when trying to define a type based on a generic object.
program E2574;
{$APPTYPE CONSOLE}
uses
SysUtils;
type
TGenClass<T> = class
end;
TClass = type TGenClass<Integer>; //E2574
type
TGenArray<T> = array of T;
TArray = type TGenArray<Integer>; //E2574
type
TGenRecord<T> = record
end;
TRecord = type TGenRecord<Integer>; //E2574
begin
end.