Browse Source

* patch by Aleksa Todorovic to solve another issue with nested generics, resolves #17193

git-svn-id: trunk@16496 -
florian 14 years ago
parent
commit
9dc584efbf
1 changed files with 17 additions and 0 deletions
  1. 17 0
      compiler/ptype.pas

+ 17 - 0
compiler/ptype.pas

@@ -338,6 +338,23 @@ implementation
             { Restore symtablestack }
             symtablestack.free;
             symtablestack:=oldsymtablestack;
+          end
+        else
+          begin
+            { There is comment few lines before ie 200512115 
+              saying "We are parsing the same objectdef, the def index numbers 
+              are the same". This is wrong (index numbers are not same) 
+              in case there is specialization (S2 in this case) inside 
+              specialized generic (G2 in this case) which is equal to 
+              some previous specialization (S1 in this case). In that case, 
+              new symbol is not added to currently specialized type 
+              (S in this case) for that specializations (S2 in this case), 
+              and this results in that specialization and generic definition 
+              don't have same number of elements in their object symbol tables. 
+              This patch adds undefined def to ensure that those 
+              two symbol tables will have same number of elements. 
+            }
+            tundefineddef.create;
           end;
 
         generictypelist.free;