* in equal_genfunc_paradefs take care of the fact that typesym might not be assigned for open array parameters, resolves #38012

git-svn-id: trunk@47253 -
This commit is contained in:
florian 2020-10-29 21:00:03 +00:00
parent 5f04bb4a8e
commit 1266afc0d0
3 changed files with 18 additions and 2 deletions

1
.gitattributes vendored
View File

@ -18499,6 +18499,7 @@ tests/webtbs/tw37926.pp svneol=native#text/pascal
tests/webtbs/tw37949.pp svneol=native#text/pascal
tests/webtbs/tw3796.pp svneol=native#text/plain
tests/webtbs/tw37969.pp svneol=native#text/pascal
tests/webtbs/tw38012.pp svneol=native#text/pascal
tests/webtbs/tw3805.pp svneol=native#text/plain
tests/webtbs/tw3814.pp svneol=native#text/plain
tests/webtbs/tw3827.pp svneol=native#text/plain

View File

@ -2622,8 +2622,9 @@ implementation
function equal_genfunc_paradefs(fwdef,currdef:tdef;fwpdst,currpdst:tsymtable): boolean;
begin
result:=false;
if (sp_generic_para in fwdef.typesym.symoptions) and
(sp_generic_para in currdef.typesym.symoptions) and
{ for open array parameters, typesym might not be assigned }
if assigned(fwdef.typesym) and (sp_generic_para in fwdef.typesym.symoptions) and
assigned(currdef.typesym) and (sp_generic_para in currdef.typesym.symoptions) and
(fwdef.owner=fwpdst) and
(currdef.owner=currpdst) then
begin

14
tests/webtbs/tw38012.pp Normal file
View File

@ -0,0 +1,14 @@
{$mode objfpc}
program test;
generic procedure DoThis<T>(msg: T);
begin
end;
generic procedure DoThis<T>(a: array of T);
begin
end;
begin
end.