浏览代码

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

Sven/Sarah Barth 1 年之前
父节点
当前提交
11200cfaf6
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      compiler/symtable.pas

+ 4 - 2
compiler/symtable.pas

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