diff --git a/.gitattributes b/.gitattributes index 900d454a12..dde03bfa8d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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 diff --git a/compiler/htypechk.pas b/compiler/htypechk.pas index 605a81aa71..2d93bc4ec3 100644 --- a/compiler/htypechk.pas +++ b/compiler/htypechk.pas @@ -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 diff --git a/tests/webtbs/tw19452a.pp b/tests/webtbs/tw19452a.pp new file mode 100644 index 0000000000..89cd2daaf5 --- /dev/null +++ b/tests/webtbs/tw19452a.pp @@ -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. +