Check the following code:
function A(const points: TArray<TPoint>): Boolean;
begin
//Something
end;
procedure B(var pts: array of TPoint)
begin
A(pts); //Compiler error E2010 Incompatible types
end;
It yields a compiler error:
E2010 Incompatible types: 'System.TArray' and 'array of TPoint'
Calling A(TArray<>(pts));
doesn't work. I solve the problem doing
A(TArray<TPoint>(@pts));
Is it the proper way to typecast an open array parameter to TArray<>? Is there any other way?
Please assume that parameters type of both function can not be changed.