Jelajahi Sumber

* Patch from Simone Tacconi to fix GetDeclaration for specialize types. Fixes issue #41095

Michaël Van Canneyt 7 bulan lalu
induk
melakukan
74614c02c6
1 mengubah file dengan 7 tambahan dan 1 penghapusan
  1. 7 1
      packages/fcl-passrc/src/pastree.pp

+ 7 - 1
packages/fcl-passrc/src/pastree.pp

@@ -2380,6 +2380,7 @@ function TPasSpecializeType.GetDeclaration(full: boolean): TPasTreeString;
 var
   i: Integer;
   aParam: TPasElement;
+  lTmp : String;
 begin
   Result:='specialize '+DestType.Name+'<';
   for i:=0 to Params.Count-1 do
@@ -2390,8 +2391,13 @@ 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 and (Name<>'') then
     begin
     Result:=Name+' = '+Result;