* prefer "any array" -> "open array" over "single element" -> "open array"

conversions, instead failing to choose the best overload (Delphi-compatible)

git-svn-id: trunk@17800 -
This commit is contained in:
Jonas Maebe 2011-06-22 19:32:28 +00:00
parent e490fb1d9d
commit 19fb48dfa9
4 changed files with 25 additions and 2 deletions

1
.gitattributes vendored
View File

@ -9112,6 +9112,7 @@ tests/tbs/tb0572.pp svneol=native#text/plain
tests/tbs/tb0573.pp svneol=native#text/plain
tests/tbs/tb0574.pp svneol=native#text/pascal
tests/tbs/tb0575.pp svneol=native#text/plain
tests/tbs/tb0576.pp svneol=native#text/plain
tests/tbs/tb205.pp svneol=native#text/plain
tests/tbs/ub0060.pp svneol=native#text/plain
tests/tbs/ub0069.pp svneol=native#text/plain

View File

@ -664,7 +664,9 @@ implementation
equal_defs(def_from,tarraydef(def_to).elementdef) then
begin
doconv:=tc_equal;
eq:=te_convert_l1;
{ also update in htypechk.pas/var_para_allowed if changed
here }
eq:=te_convert_l3;
end
else
begin

View File

@ -1609,7 +1609,7 @@ implementation
eq:=te_convert_l2
else
if equal_defs(def_from,tarraydef(def_to).elementdef) then
eq:=te_convert_l2;
eq:=te_convert_l3;
end;
end;
pointerdef :

20
tests/tbs/tb0576.pp Normal file
View File

@ -0,0 +1,20 @@
{ %norun }
{$mode delphi}
type ByteArray = array of byte;
procedure ZeroMemory(var X: array of byte; StartIndex, Count: integer); overload;
begin
end;
procedure ZeroMemory(var X: array of ByteArray; StartIndex, Count: integer); overload;
begin
end;
var
buffer: array of byte;
begin
ZeroMemory(Buffer, 0, Length(Buffer));
end.