From c10e57f1d8cce6f00977245d184c3ab5c65c1260 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Van=20Canneyt?= Date: Tue, 28 Jan 2025 14:24:15 +0100 Subject: [PATCH] * Patch from Simone Tacconi to fix WriteProc. Fixes issue #41100 --- packages/fcl-passrc/src/pastree.pp | 7 ++++++- packages/fcl-passrc/src/paswrite.pp | 10 +--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/packages/fcl-passrc/src/pastree.pp b/packages/fcl-passrc/src/pastree.pp index dd45da3e09..78548cae3b 100644 --- a/packages/fcl-passrc/src/pastree.pp +++ b/packages/fcl-passrc/src/pastree.pp @@ -2310,6 +2310,7 @@ function TInlineSpecializeExpr.GetDeclaration(full: Boolean): TPasTreeString; var i: Integer; aParam: TPasElement; + lTmp : String; begin Result:='specialize '+NameExpr.GetDeclaration(false)+'<'; for i:=0 to Params.Count-1 do @@ -2320,7 +2321,11 @@ begin if aParam is TPasMembersType then Result:=Result+aParam.FullName else - Result:=Result+aParam.GetDeclaration(false); + begin + lTmp:=aParam.GetDeclaration(aParam is TPasUnresolvedTypeRef); + lTmp[1]:=UpCase(lTmp[1]); + Result:=Result+lTmp; + end; end; Result:=Result+'>'; if full then ; diff --git a/packages/fcl-passrc/src/paswrite.pp b/packages/fcl-passrc/src/paswrite.pp index 0813418ece..ee053f331b 100644 --- a/packages/fcl-passrc/src/paswrite.pp +++ b/packages/fcl-passrc/src/paswrite.pp @@ -934,15 +934,7 @@ begin IsImpl:=FInImplementation; if FInImplementation and not forcebody and (Assigned(AProc.LibraryExpr) or Assigned(AProc.LibrarySymbolName)) and HasOption(woSkipPrivateExternals) then Exit; - Add(AProc.TypeName + ' ' + NamePrefix+AProc.SafeName); - if Assigned(AProc.ProcType) and (AProc.ProcType.Args.Count > 0) then - AddProcArgs(AProc.ProcType.Args) ; - if Assigned(AProc.ProcType) and - (AProc.ProcType.ClassType = TPasFunctionType) then - begin - Add(': '); - WriteType(TPasFunctionType(AProc.ProcType).ResultEl.ResultType,False); - end; + Add(AProc.GetDeclaration(True)); Add(';'); // delphi compatible order for example: procedure foo; reintroduce; overload; static; if not IsImpl and AProc.IsReintroduced then