Browse Source

fcl-passrc: resolver: fixed specialize name of A<B<C>>

git-svn-id: trunk@47676 -
Mattias Gaertner 4 years ago
parent
commit
055cfa28b7

+ 2 - 1
packages/fcl-passrc/src/pasresolveeval.pas

@@ -1069,7 +1069,8 @@ begin
         begin
         GenType:=TPasGenericType(El);
         if (GenType.GenericTemplateTypes<>nil)
-            and (GenType.GenericTemplateTypes.Count>0) then
+            and (GenType.GenericTemplateTypes.Count>0)
+            and (Pos('<',El.Name)<1) then
           Result:=GetGenericParamCommas(GenType.GenericTemplateTypes.Count)+Result;
         end;
       if El.Name<>'' then

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

@@ -16734,7 +16734,7 @@ function TPasResolver.CreateSpecializedTypeName(Item: TPRSpecializedItem): strin
       else
         Result:=aType.GetModule.Name;
       Result:=Result+'.'+aType.Name;
-      if aType.CustomData is TPasGenericScope then
+      if (aType.CustomData is TPasGenericScope) and (Pos('<',aType.Name)<1) then
         begin
         ChildItem:=TPasGenericScope(aType.CustomData).SpecializedFromItem;
         if ChildItem<>nil then
@@ -16744,7 +16744,13 @@ function TPasResolver.CreateSpecializedTypeName(Item: TPRSpecializedItem): strin
   end;
 
 begin
+  if Pos('<',Item.GenericEl.Name)>0 then
+    RaiseNotYetImplemented(20201203140102,Item.SpecializedEl,Item.GenericEl.Name);
+
   Result:=Item.GenericEl.Name+GetSpecParams(Item);
+
+  if Pos('><',Result)>0 then
+    RaiseNotYetImplemented(20201203140223,Item.SpecializedEl,Result);
 end;
 
 procedure TPasResolver.InitSpecializeScopes(El: TPasElement; out