mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-14 00:02:06 +02:00
* fix for issue introduced in r28862: the compiler considered also
dynamic arrays and fixed-length static arrays when looking for overloads of array constructors, while these are not valid in such cases (and it also gave an error afterwards when trying to actually use them). This caused a lot of spurious "can't select which overloaded routine to call" errors when using many JVM routines git-svn-id: trunk@29393 -
This commit is contained in:
parent
7f23fcd02c
commit
bad1b2a1c1
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -13752,6 +13752,7 @@ tests/webtbs/tw1938.pp svneol=native#text/plain
|
||||
tests/webtbs/tw19434a.pp svneol=native#text/plain
|
||||
tests/webtbs/tw19434b.pp svneol=native#text/plain
|
||||
tests/webtbs/tw19452.pp svneol=native#text/plain
|
||||
tests/webtbs/tw19452a.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1948.pp svneol=native#text/plain
|
||||
tests/webtbs/tw19498.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw19499.pp svneol=native#text/pascal
|
||||
|
@ -2780,7 +2780,7 @@ implementation
|
||||
eq:=compare_defs_ext(n.resultdef,def_to,n.nodetype,convtype,pdoper,cdoptions);
|
||||
n.free;
|
||||
end
|
||||
else if (def_to.typ=arraydef) and
|
||||
else if is_open_array(def_to) and
|
||||
is_class_or_interface_or_dispinterface_or_objc_or_java(tarraydef(def_to).elementdef) and
|
||||
is_array_constructor(currpt.left.resultdef) and
|
||||
assigned(tarrayconstructornode(currpt.left).left) then
|
||||
|
24
tests/webtbs/tw19452a.pp
Normal file
24
tests/webtbs/tw19452a.pp
Normal file
@ -0,0 +1,24 @@
|
||||
{ %norun }
|
||||
|
||||
{$mode objfpc}
|
||||
type
|
||||
TMyObject = class;
|
||||
TArr = array of TMyObject;
|
||||
TMyObject = class
|
||||
public
|
||||
constructor Create(ar: array of TMyObject); overload;
|
||||
constructor Create(ar: TArr); overload;
|
||||
end;
|
||||
|
||||
constructor TMyObject.Create(ar: array of TMyObject);
|
||||
begin
|
||||
end;
|
||||
|
||||
constructor TMyObject.Create(ar: Tarr);
|
||||
begin
|
||||
end;
|
||||
|
||||
begin
|
||||
TMyObject.Create([nil]);
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user