I'm trying to add an Append method to the System.Generics.Collections.TArray type.
unit uMyArray;
interface
uses
System.Generics.Collections;
type
TArray = class(System.Generics.Collections.TArray)
public
class procedure Append<T>(var AValues: array of T; const AItem: T); static;
end;
implementation
class procedure TArray.Append<T>(var AValues: array of T; const AItem: T);
begin
SetLength(AValues, Length(AValues) + 1);
AValues[Length(AValues) - 1] := AItem;
end;
end.
On compiling I get the following error on the SetLength line:
[dcc32 Error] uMyArray.pas(18): E2008 Incompatible types
TList?