ソースを参照

* 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)