From 68f79e0b823aaf55a9e35300d12d9aef679b5f2e Mon Sep 17 00:00:00 2001 From: Henrique Gottardi Werlang Date: Mon, 20 Dec 2021 14:51:36 -0300 Subject: [PATCH] Adjusted the generic implementation to generate the type according to the declaration and not the basis of the type. --- packages/fcl-passrc/src/pasresolver.pp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/fcl-passrc/src/pasresolver.pp b/packages/fcl-passrc/src/pasresolver.pp index 1446b7799f..6065ec4d87 100644 --- a/packages/fcl-passrc/src/pasresolver.pp +++ b/packages/fcl-passrc/src/pasresolver.pp @@ -1470,7 +1470,8 @@ type TPRResolveAlias = ( prraNone, // do not resolve alias prraSimple, // resolve alias, but not type alias - prraAlias // resolve alias and type alias + prraAlias, // resolve alias and type alias + prraHighType ); TPRProcTypeDescFlag = ( @@ -24314,6 +24315,11 @@ begin if IsSameType(Arg1Resolved.HiTypeEl,Arg2Resolved.HiTypeEl,prraSimple) then exit(cExact); end + else if ResolveAlias=prraHighType then + begin + if IsSameType(Arg1Resolved.HiTypeEl,Arg2Resolved.HiTypeEl,prraNone) then + exit(cExact); + end else begin if IsSameType(Arg1Resolved.LoTypeEl,Arg2Resolved.LoTypeEl,prraNone) then @@ -29220,8 +29226,8 @@ begin begin Param:=TPasElement(Params[i]); ComputeElement(Param,ResolvedEl,[rcType]); - ParamsResolved[i]:=ResolvedEl.LoTypeEl; - if ResolvedEl.LoTypeEl<>TPasType(GenericTemplateList[i]) then + ParamsResolved[i]:=ResolvedEl.HiTypeEl; + if ResolvedEl.HiTypeEl<>TPasType(GenericTemplateList[i]) then IsSelf:=false; end; if IsSelf then @@ -29244,7 +29250,7 @@ begin while j>=0 do begin if not IsSameType(Item.Params[j],ParamsResolved[j],prraNone) - and (CheckElTypeCompatibility(Item.Params[j],ParamsResolved[j],prraNone)>cExact) then + and (CheckElTypeCompatibility(Item.Params[j],ParamsResolved[j],prraHighType)>cExact) then break; dec(j); end;