summary refs log tree commit diff stats
path: root/compiler/semstmts.nim
diff options
context:
space:
mode:
authorZahary Karadjov <zahary@gmail.com>2013-05-12 01:20:40 +0300
committerZahary Karadjov <zahary@gmail.com>2013-05-12 01:20:40 +0300
commit7a2b1a7520bb80cbef88ad9c3dc843cbe512a588 (patch)
tree3a618acb804f76d1110c8037a5b2fb74b61adb5a /compiler/semstmts.nim
parent3d1c6de63853dc141b919dc853ade4380a478206 (diff)
downloadNim-7a2b1a7520bb80cbef88ad9c3dc843cbe512a588.tar.gz
get rid of ImportTablePos and ModuleTablePos
Diffstat (limited to 'compiler/semstmts.nim')
-rw-r--r--compiler/semstmts.nim5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim
index 0998f45a5..fc98ff703 100644
--- a/compiler/semstmts.nim
+++ b/compiler/semstmts.nim
@@ -289,8 +289,9 @@ proc fitRemoveHiddenConv(c: PContext, typ: Ptype, n: PNode): PNode =
     changeType(result, typ, check=false)
 
 proc findShadowedVar(c: PContext, v: PSym): PSym =
-  for i in countdown(c.tab.tos - 2, ModuleTablePos+1):
-    let shadowed = StrTableGet(c.tab.stack[i], v.name)
+  for scope in walkScopes(c.currentScope.parent):
+    if scope == c.topLevelScope: break
+    let shadowed = StrTableGet(scope.symbols, v.name)
     if shadowed != nil and shadowed.kind in skLocalVars:
       return shadowed