Delphi 泛型类型的限制

Delphi 泛型类型的限制,delphi,generics,Delphi,Generics,此具有泛型类型的声明将不会编译 type TFoo<T> = record Value : T; end; TFooo = TFoo<TFoo<Int64>>; // this is fine TFoooooInt64 = TFoo<TFoo<TFoo<Int64>>>; // E2564 类型 TFoo=记录 值:T; 结束; TFooo=TFoo;//这很好 tfoooint64=TFoo;/

此具有泛型类型的声明将不会编译

type
  TFoo<T> = record
    Value : T;
  end;

  TFooo = TFoo<TFoo<Int64>>; // this is fine
  TFoooooInt64 = TFoo<TFoo<TFoo<Int64>>>; // E2564
类型
TFoo=记录
值:T;
结束;
TFooo=TFoo;//这很好
tfoooint64=TFoo;//E2564
因为

E2564未定义类型“
TFoo

此错误E2564如下所示

当试图使用泛型类型本身定义类型约束时,会发生这种情况

program E2564;
 
{$APPTYPE CONSOLE}
type
  TRec<T: record> = record
    A: T;
  end;
 
  TClass = record
    V: TRec<TClass>; //E2564
  end;

begin
end.
程序E2564;
{$APPTYPE控制台}
类型
TRec=记录
A:T;
结束;
TClass=记录
V:TRec//E2564
结束;
开始
结束。
但事实并非如此


这是一个bug还是有文档记录的限制?

没有文档记录,这是一个bug吗?只有Emba才能回答这个问题。是的,我想是的,现在我正在等待设计(但未记录)的知名作品回答:o)