* Patch from Simone Tacconi to fix WriteProc. Fixes issue #41100

This commit is contained in:
Michaël Van Canneyt 2025-01-28 14:24:15 +01:00
parent 9602ec5336
commit c10e57f1d8
2 changed files with 7 additions and 10 deletions

View File

@ -2310,6 +2310,7 @@ function TInlineSpecializeExpr.GetDeclaration(full: Boolean): TPasTreeString;
var var
i: Integer; i: Integer;
aParam: TPasElement; aParam: TPasElement;
lTmp : String;
begin begin
Result:='specialize '+NameExpr.GetDeclaration(false)+'<'; Result:='specialize '+NameExpr.GetDeclaration(false)+'<';
for i:=0 to Params.Count-1 do for i:=0 to Params.Count-1 do
@ -2320,7 +2321,11 @@ begin
if aParam is TPasMembersType then if aParam is TPasMembersType then
Result:=Result+aParam.FullName Result:=Result+aParam.FullName
else else
Result:=Result+aParam.GetDeclaration(false); begin
lTmp:=aParam.GetDeclaration(aParam is TPasUnresolvedTypeRef);
lTmp[1]:=UpCase(lTmp[1]);
Result:=Result+lTmp;
end;
end; end;
Result:=Result+'>'; Result:=Result+'>';
if full then ; if full then ;

View File

@ -934,15 +934,7 @@ begin
IsImpl:=FInImplementation; IsImpl:=FInImplementation;
if FInImplementation and not forcebody and (Assigned(AProc.LibraryExpr) or Assigned(AProc.LibrarySymbolName)) and HasOption(woSkipPrivateExternals) then if FInImplementation and not forcebody and (Assigned(AProc.LibraryExpr) or Assigned(AProc.LibrarySymbolName)) and HasOption(woSkipPrivateExternals) then
Exit; Exit;
Add(AProc.TypeName + ' ' + NamePrefix+AProc.SafeName); Add(AProc.GetDeclaration(True));
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(';'); Add(';');
// delphi compatible order for example: procedure foo; reintroduce; overload; static; // delphi compatible order for example: procedure foo; reintroduce; overload; static;
if not IsImpl and AProc.IsReintroduced then if not IsImpl and AProc.IsReintroduced then