Browse Source

* use check_strict_private and check_strict_protected in their respective non-strict checks to avoid code duplication

Sven/Sarah Barth 1 year ago
parent
commit
11200cfaf6
1 changed files with 4 additions and 2 deletions
  1. 4 2
      compiler/symtable.pas

+ 4 - 2
compiler/symtable.pas

@@ -3372,7 +3372,8 @@ implementation
             begin
               { private symbols are allowed when we are in the same
                 module as they are defined }
-              result:=(
+              result:=check_strict_private or
+                      (
                        (nonlocalst.symtabletype in [globalsymtable,staticsymtable]) and
                        is_current_unit(nonlocalst)
                       ) or
@@ -3417,7 +3418,8 @@ implementation
               { protected symbols are visible in the module that defines them and
                 also visible to related objects. The related object must be defined
                 in the current module }
-              result:=(
+              result:=check_strict_protected or
+                      (
                        (
                         (nonlocalst.symtabletype in [globalsymtable,staticsymtable]) and
                         is_current_unit(nonlocalst)