Parcourir la source

Improved handling of module local resolution.

woollybah il y a 9 ans
Parent
commit
7fe13848be
1 fichiers modifiés avec 6 ajouts et 1 suppressions
  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