Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 990
BofA Avatar asked Feb 24 '12 10:02

BofA


1 Answers

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

like image 99
Linas Avatar answered Oct 19 '22 22:10

Linas