Browse Source

Improved handling of module local resolution.

woollybah 9 years ago
parent
commit
7fe13848be
1 changed files with 6 additions and 1 deletions
  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