mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 14:09:20 +02:00
* perform real "exactness" checking for open array parameters
git-svn-id: trunk@9624 -
This commit is contained in:
parent
337e53e712
commit
08ccb30e3b
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -6039,6 +6039,7 @@ tests/tbf/tb0202.pp svneol=native#text/plain
|
|||||||
tests/tbf/tb0203.pp svneol=native#text/plain
|
tests/tbf/tb0203.pp svneol=native#text/plain
|
||||||
tests/tbf/tb0204.pp svneol=native#text/plain
|
tests/tbf/tb0204.pp svneol=native#text/plain
|
||||||
tests/tbf/tb0204a.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/ub0115.pp svneol=native#text/plain
|
||||||
tests/tbf/ub0149.pp svneol=native#text/plain
|
tests/tbf/ub0149.pp svneol=native#text/plain
|
||||||
tests/tbf/ub0158a.pp svneol=native#text/plain
|
tests/tbf/ub0158a.pp svneol=native#text/plain
|
||||||
|
@ -705,6 +705,9 @@ implementation
|
|||||||
{ open array -> open array }
|
{ open array -> open array }
|
||||||
if is_open_array(def_from) and
|
if is_open_array(def_from) and
|
||||||
equal_defs(tarraydef(def_from).elementdef,tarraydef(def_to).elementdef) then
|
equal_defs(tarraydef(def_from).elementdef,tarraydef(def_to).elementdef) then
|
||||||
|
if tarraydef(def_from).elementdef=tarraydef(def_to).elementdef then
|
||||||
|
eq:=te_exact
|
||||||
|
else
|
||||||
eq:=te_equal
|
eq:=te_equal
|
||||||
else
|
else
|
||||||
{ array -> open array }
|
{ array -> open array }
|
||||||
@ -1566,12 +1569,13 @@ implementation
|
|||||||
{ check type }
|
{ check type }
|
||||||
if eq=te_incompatible then
|
if eq=te_incompatible then
|
||||||
exit;
|
exit;
|
||||||
{ open arrays can never match exactly, since you cannot define }
|
{ open strings can never match exactly, since you cannot define }
|
||||||
{ a separate "open array" type -> we have to be able to }
|
{ a separate "open string" type -> we have to be able to }
|
||||||
{ consider those as exact when resolving forward definitions. }
|
{ consider those as exact when resolving forward definitions. }
|
||||||
{ The same goes for openstrings and array of const }
|
{ The same goes for array of const. Open arrays are handled }
|
||||||
if (is_open_array(currpara1.vardef) or
|
{ already (if their element types match exactly, they are }
|
||||||
is_array_of_const(currpara1.vardef) or
|
{ considered to be an exact match) }
|
||||||
|
if (is_array_of_const(currpara1.vardef) or
|
||||||
is_open_string(currpara1.vardef)) and
|
is_open_string(currpara1.vardef)) and
|
||||||
(eq=te_equal) and
|
(eq=te_equal) and
|
||||||
(cpo_openequalisexact in cpoptions) then
|
(cpo_openequalisexact in cpoptions) then
|
||||||
|
14
tests/tbf/tb0205.pp
Normal file
14
tests/tbf/tb0205.pp
Normal 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.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user