mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-13 17:59:27 +02:00
* allow passing single element to open array bug6960
git-svn-id: trunk@3634 -
This commit is contained in:
parent
2ddd617971
commit
5e5edcb520
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -6828,6 +6828,7 @@ tests/webtbs/tw6684.pp svneol=native#text/plain
|
||||
tests/webtbs/tw6735.pp svneol=native#text/plain
|
||||
tests/webtbs/tw6742.pp svneol=native#text/plain
|
||||
tests/webtbs/tw6767.pp svneol=native#text/plain
|
||||
tests/webtbs/tw6960.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
|
||||
|
@ -1336,10 +1336,15 @@ implementation
|
||||
end;
|
||||
arraydef :
|
||||
begin
|
||||
if is_open_array(def_to) and
|
||||
is_dynamic_array(def_from) and
|
||||
equal_defs(tarraydef(def_from).elementtype.def,tarraydef(def_to).elementtype.def) then
|
||||
eq:=te_convert_l2;
|
||||
if is_open_array(def_to) then
|
||||
begin
|
||||
if is_dynamic_array(def_from) and
|
||||
equal_defs(tarraydef(def_from).elementtype.def,tarraydef(def_to).elementtype.def) then
|
||||
eq:=te_convert_l2
|
||||
else
|
||||
if equal_defs(def_from,tarraydef(def_to).elementtype.def) then
|
||||
eq:=te_convert_l2;
|
||||
end;
|
||||
end;
|
||||
pointerdef :
|
||||
begin
|
||||
|
14
tests/webtbs/tw6960.pp
Normal file
14
tests/webtbs/tw6960.pp
Normal file
@ -0,0 +1,14 @@
|
||||
function SomeFunc(var Res: array of Double): Integer;
|
||||
begin
|
||||
// do something
|
||||
writeln(High(Res));
|
||||
end;
|
||||
|
||||
var
|
||||
d: Double;
|
||||
darr: array[1..3] of Double;
|
||||
begin
|
||||
SomeFunc(d); // Delphi accepts this, FPC does not
|
||||
SomeFunc(darr); // OK
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user