소스 검색

pexpr.pas, sub_expr:
* generate_inline_specialization: fix Delphi-style inline specializations of generic methods

git-svn-id: trunk@32438 -

svenbarth 9 년 전
부모
커밋
b2988ad8c0
1개의 변경된 파일20개의 추가작업 그리고 17개의 파일을 삭제
  1. 20 17
      compiler/pexpr.pas

+ 20 - 17
compiler/pexpr.pas

@@ -3965,26 +3965,29 @@ implementation
             end
           else
             begin
-              result:=nil;
-              { check if it's a method/class method }
-              if is_member_read(gensym,gensym.owner,result,parseddef) then
+              if gensym.typ=procsym then
                 begin
-                  { if we are accessing a owner procsym from the nested }
-                  { class we need to call it as a class member }
-                  if (gensym.owner.symtabletype in [ObjectSymtable,recordsymtable]) and
-                      assigned(current_structdef) and (current_structdef<>parseddef) and is_owned_by(current_structdef,parseddef) then
+                  result:=nil;
+                  { check if it's a method/class method }
+                  if is_member_read(gensym,gensym.owner,result,parseddef) then
                     begin
-                      result:=cloadvmtaddrnode.create(ctypenode.create(parseddef));
-                      { not srsymtable.symtabletype since that can be }
-                      { withsymtable as well                          }
-                      if (gensym.owner.symtabletype in [ObjectSymtable,recordsymtable]) then
+                      { if we are accessing a owner procsym from the nested }
+                      { class we need to call it as a class member }
+                      if (gensym.owner.symtabletype in [ObjectSymtable,recordsymtable]) and
+                          assigned(current_structdef) and (current_structdef<>parseddef) and is_owned_by(current_structdef,parseddef) then
                         begin
-                          do_member_read(tabstractrecorddef(parseddef),getaddr,gensym,result,again,[],spezcontext);
-                          spezcontext:=nil;
-                        end
-                      else
-                        { no procsyms in records (yet) }
-                        internalerror(2015092704);
+                          result:=cloadvmtaddrnode.create(ctypenode.create(parseddef));
+                          { not srsymtable.symtabletype since that can be }
+                          { withsymtable as well                          }
+                          if (gensym.owner.symtabletype in [ObjectSymtable,recordsymtable]) then
+                            begin
+                              do_member_read(tabstractrecorddef(parseddef),getaddr,gensym,result,again,[],spezcontext);
+                              spezcontext:=nil;
+                            end
+                          else
+                            { no procsyms in records (yet) }
+                            internalerror(2015092704);
+                        end;
                     end
                   else
                     begin