Browse Source

* adjust check for non-static class methods in class helpers in so far that only classes allow such methods (interfaces and objects would not either)

git-svn-id: trunk@36937 -
svenbarth 8 years ago
parent
commit
b6a3d66224
1 changed files with 4 additions and 1 deletions
  1. 4 1
      compiler/pdecobj.pas

+ 4 - 1
compiler/pdecobj.pas

@@ -907,7 +907,10 @@ implementation
                   { for record and type helpers only static class methods are
                     allowed }
                   if is_objectpascal_helper(astruct) and
-                     (tobjectdef(astruct).extendeddef.typ<>objectdef) and
+                     (
+                       (tobjectdef(astruct).extendeddef.typ<>objectdef) or
+                       (tobjectdef(tobjectdef(astruct).extendeddef).objecttype<>odt_class)
+                     ) and
                      is_classdef and not (po_staticmethod in result.procoptions) then
                     MessagePos(result.fileinfo,parser_e_class_methods_only_static_in_records);