Browse Source

pexpr.pas:
* sub_expr: don't extract the def from the node using gettypedef, but use the already retrieved symbol instead

git-svn-id: trunk@32371 -

svenbarth 9 years ago
parent
commit
fe39de1573
1 changed files with 7 additions and 3 deletions
  1. 7 3
      compiler/pexpr.pas

+ 7 - 3
compiler/pexpr.pas

@@ -4093,9 +4093,13 @@ implementation
                        { for now we're handling this as a generic declaration;
                          there could be cases though (because of operator
                          overloading) where this is the wrong decision... }
-                       { TODO : here the same note as in _LT applies as p2 could
-                                point to a variable, etc }
-                       gendef:=gettypedef(p2);
+                       if gensym.typ=typesym then
+                         gendef:=ttypesym(gensym).typedef
+                       else
+                         if gensym.typ=procsym then
+                           gendef:=tdef(tprocsym(gensym).procdeflist[0])
+                         else
+                           internalerror(2015072401);
 
                        ptmp:=generate_inline_specialization(gendef,p2,filepos,nil,nil,nil);