浏览代码

Improved handling of module local resolution.

woollybah 9 年之前
父节点
当前提交
7fe13848be
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      expr.bmx

+ 6 - 1
expr.bmx

@@ -2221,7 +2221,12 @@ Type TIdentExpr Extends TExpr
 		If TLocalDecl( vdecl )
 			' local variable should (at least) be in the same function scope.
 			If vdecl.FuncScope() <> scope.FuncScope() Then
-				vdecl = Null
+				' or the local can be in localmain..
+				If TModuleDecl(scope) And vdecl.FuncScope() And vdecl.FuncScope().ident = "__LocalMain" Then
+					' ok
+				Else
+					vdecl = Null
+				End If
 			End If
 		End If