What should I do about an internal error when I declare a generic “array of T”?

邮差的信 提交于 2019-12-12 10:35:05

问题


This unit fails to compile in XE2 Update 3 with "[DCC Fatal Error] Test.pas(22): F2084 Internal Error: URW1147"

unit Test;

interface

type
  TSorter<T> = procedure(var Values: array of T);

  TTest = class
  public
    procedure Sort<T>(const Sorter: TSorter<T>);
  end;

implementation

procedure TTest.Sort<T>(const Sorter: TSorter<T>);
begin
end;

end.

I have submitted a QC report: QC#103671.

Does anyone have an idea about workaround for this?


回答1:


If you replace TSorter declaration with TSorter<T> = procedure(var Values: TArray<T>); it compiles fine on XE.



来源:https://stackoverflow.com/questions/9429484/what-should-i-do-about-an-internal-error-when-i-declare-a-generic-array-of-t

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!