mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-05 21:10:24 +02:00
* add cdo_parameter option for def_compare_ext that indicates that we
are comparing parameter lists * openarray and normal array are not compatible anymore when comparing parameters git-svn-id: trunk@4754 -
This commit is contained in:
parent
728b4bcf11
commit
0ddab0c161
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -7344,6 +7344,7 @@ tests/webtbs/tw7391.pp svneol=native#text/plain
|
||||
tests/webtbs/tw7425.pp svneol=native#text/plain
|
||||
tests/webtbs/tw7440.pp svneol=native#text/plain
|
||||
tests/webtbs/tw7446.pp svneol=native#text/plain
|
||||
tests/webtbs/tw7489.pp svneol=native#text/plain
|
||||
tests/webtbs/ub1873.pp svneol=native#text/plain
|
||||
tests/webtbs/ub1883.pp svneol=native#text/plain
|
||||
tests/webtbs/uw0555.pp svneol=native#text/plain
|
||||
|
@ -37,7 +37,7 @@ interface
|
||||
tcompare_paras_option = (cpo_allowdefaults,cpo_ignorehidden,cpo_allowconvert,cpo_comparedefaultvalue);
|
||||
tcompare_paras_options = set of tcompare_paras_option;
|
||||
|
||||
tcompare_defs_option = (cdo_internal,cdo_explicit,cdo_check_operator,cdo_allow_variant);
|
||||
tcompare_defs_option = (cdo_internal,cdo_explicit,cdo_check_operator,cdo_allow_variant,cdo_parameter);
|
||||
tcompare_defs_options = set of tcompare_defs_option;
|
||||
|
||||
tconverttype = (tc_none,
|
||||
@ -675,7 +675,8 @@ implementation
|
||||
end
|
||||
else
|
||||
{ array -> open array }
|
||||
if equal_defs(tarraydef(def_from).elementtype.def,tarraydef(def_to).elementtype.def) then
|
||||
if not(cdo_parameter in cdoptions) and
|
||||
equal_defs(tarraydef(def_from).elementtype.def,tarraydef(def_to).elementtype.def) then
|
||||
eq:=te_equal;
|
||||
end
|
||||
else
|
||||
@ -708,7 +709,8 @@ implementation
|
||||
{ other arrays }
|
||||
begin
|
||||
{ open array -> array }
|
||||
if is_open_array(def_from) and
|
||||
if not(cdo_parameter in cdoptions) and
|
||||
is_open_array(def_from) and
|
||||
equal_defs(tarraydef(def_from).elementtype.def,tarraydef(def_to).elementtype.def) then
|
||||
begin
|
||||
eq:=te_equal
|
||||
@ -1376,7 +1378,7 @@ implementation
|
||||
i1,i2 : byte;
|
||||
begin
|
||||
compare_paras:=te_incompatible;
|
||||
cdoptions:=[cdo_check_operator,cdo_allow_variant];
|
||||
cdoptions:=[cdo_parameter,cdo_check_operator,cdo_allow_variant];
|
||||
{ we need to parse the list from left-right so the
|
||||
not-default parameters are checked first }
|
||||
lowesteq:=high(tequaltype);
|
||||
|
26
tests/webtbs/tw7489.pp
Executable file
26
tests/webtbs/tw7489.pp
Executable file
@ -0,0 +1,26 @@
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
uses
|
||||
Classes, SysUtils
|
||||
{ add your units here };
|
||||
|
||||
type
|
||||
TSingle3DVector = array[0..2] of single;
|
||||
TSingle4DVector = array[0..3] of single;
|
||||
|
||||
function VectorLength(const aV3D : TSingle3DVector) : single; overload;
|
||||
begin
|
||||
end;
|
||||
|
||||
function VectorLength(const aV4D : TSingle4DVector) : single; overload;
|
||||
begin
|
||||
end;
|
||||
|
||||
function VectorLength(const aVxD : array of single) : single; overload;
|
||||
begin
|
||||
end;
|
||||
|
||||
|
||||
begin
|
||||
end.
|
Loading…
Reference in New Issue
Block a user