When compiled under Delphi 7 or Delphi XE, the code below complains
[DCC Error] Project1.dpr(25): E2010 Incompatible types: 'array of Char' and 'TAChar'
According to Rudy's article, it should be allowed to pass typed array to open array ?
Furthermore, why does it not complain for 'array of Boolean' and 'TABoolean' ?
Many thanks for help !
program Project1;
{$APPTYPE CONSOLE}
uses
SysUtils;
type
TAChar = array of Char;
TABoolean = array of Boolean;
procedure Test1(const CharArr: array of Char);
begin
end;
procedure Test2(const BoolArr: array of Boolean);
begin
end;
var
Arr1: TAChar;
Arr2: TABoolean;
begin
try
Test1(Arr1); // <------- Does not compile in Delphi 7 & XE
Test2(Arr2);
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
end.