Explorar o código

compiler: don't remove 'self' if the method is static but not a class method

git-svn-id: trunk@14579 -
paul %!s(int64=15) %!d(string=hai) anos
pai
achega
2fdf045e74
Modificáronse 1 ficheiros con 8 adicións e 5 borrados
  1. 8 5
      compiler/pdecsub.pas

+ 8 - 5
compiler/pdecsub.pas

@@ -2774,12 +2774,15 @@ const
                       if not (po_staticmethod in currpd.procoptions) then
                        begin
                          include(currpd.procoptions, po_staticmethod);
-                         { remove self from the hidden paras }
-                         symentry:=currpd.parast.Find('self');
-                         if symentry<>nil then
+                         if (po_classmethod in currpd.procoptions) then
                           begin
-                            currpd.parast.Delete(symentry);
-                            currpd.calcparas;
+                           { remove self from the hidden paras }
+                           symentry:=currpd.parast.Find('self');
+                           if symentry<>nil then
+                            begin
+                              currpd.parast.Delete(symentry);
+                              currpd.calcparas;
+                            end;
                           end;
                        end;
                     end;