瀏覽代碼

Private/Protected now globally visible within local file. Fixes #292.

woollybah 7 年之前
父節點
當前提交
b80322c1b8
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      decl.bmx

+ 6 - 0
decl.bmx

@@ -728,6 +728,7 @@ Type TGlobalDecl Extends TVarDecl
 	Method CheckAccess:Int()
 		Local cd:TClassDecl = ClassScope()
 		If cd Then
+			If cd.modulescope() = _env.modulescope() Return True
 			If IsPrivate() And cd<>_env.ClassScope() Return False
 			If IsProtected() Then
 				Local ec:TClassDecl = _env.ClassScope()
@@ -776,6 +777,10 @@ Type TFieldDecl Extends TVarDecl
 
 	Method CheckAccess:Int()
 
+		If ModuleScope() = _env.ModuleScope() Then
+			Return True
+		End If
+
 		Local cs:TClassDecl = ClassScope()
 
 		If IsPrivate() And cs Then
@@ -2192,6 +2197,7 @@ Type TFuncDecl Extends TBlockDecl
 	End Method
 
 	Method CheckAccess:Int()
+		If ModuleScope() = _env.ModuleScope() Return True
 		Local cd:TClassDecl = ClassScope()
 		If cd Then
 			If IsPrivate() And cd<>_env.ClassScope() Return False