E2574 Instantiated type can not be used for TYPE'd type declaration (Delphi)

From RAD Studio
Jump to: navigation, search

Go Up to Error and Warning Messages (Delphi)


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.