* perform real "exactness" checking for open array parameters

git-svn-id: trunk@9624 -
This commit is contained in:
Jonas Maebe 2008-01-04 12:54:47 +00:00
parent 337e53e712
commit 08ccb30e3b
3 changed files with 26 additions and 7 deletions

1
.gitattributes vendored
View File

@ -6039,6 +6039,7 @@ tests/tbf/tb0202.pp svneol=native#text/plain
tests/tbf/tb0203.pp svneol=native#text/plain
tests/tbf/tb0204.pp svneol=native#text/plain
tests/tbf/tb0204a.pp svneol=native#text/plain
tests/tbf/tb0205.pp svneol=native#text/plain
tests/tbf/ub0115.pp svneol=native#text/plain
tests/tbf/ub0149.pp svneol=native#text/plain
tests/tbf/ub0158a.pp svneol=native#text/plain

View File

@ -705,7 +705,10 @@ implementation
{ open array -> open array }
if is_open_array(def_from) and
equal_defs(tarraydef(def_from).elementdef,tarraydef(def_to).elementdef) then
eq:=te_equal
if tarraydef(def_from).elementdef=tarraydef(def_to).elementdef then
eq:=te_exact
else
eq:=te_equal
else
{ array -> open array }
if not(cdo_parameter in cdoptions) and
@ -1566,12 +1569,13 @@ implementation
{ check type }
if eq=te_incompatible then
exit;
{ open arrays can never match exactly, since you cannot define }
{ a separate "open array" type -> we have to be able to }
{ consider those as exact when resolving forward definitions. }
{ The same goes for openstrings and array of const }
if (is_open_array(currpara1.vardef) or
is_array_of_const(currpara1.vardef) or
{ open strings can never match exactly, since you cannot define }
{ a separate "open string" type -> we have to be able to }
{ consider those as exact when resolving forward definitions. }
{ The same goes for array of const. Open arrays are handled }
{ already (if their element types match exactly, they are }
{ considered to be an exact match) }
if (is_array_of_const(currpara1.vardef) or
is_open_string(currpara1.vardef)) and
(eq=te_equal) and
(cpo_openequalisexact in cpoptions) then

14
tests/tbf/tb0205.pp Normal file
View File

@ -0,0 +1,14 @@
{ %fail }
procedure test(a: array of longint); forward;
type
tl = type longint;
procedure test(a: array of tl);
begin
end;
begin
end.