summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2018-06-26 23:16:40 +0200
committerGitHub <noreply@github.com>2018-06-26 23:16:40 +0200
commitccb15148370f78768c6a5655f2b09d8ab9e85768 (patch)
treec50eff36ca3b315024ff43fc2f0741e414cc2e52 /compiler
parentbf5de98c6a68c73fb9a5e638b3877e5ef4674791 (diff)
parentf559e62e45b4be227d494e75fe82f571ee410840 (diff)
downloadNim-ccb15148370f78768c6a5655f2b09d8ab9e85768.tar.gz
Merge pull request #8108 from LemonBoy/fix-5958
Make `static` blocks introduce their own scope
Diffstat (limited to 'compiler')
-rw-r--r--compiler/semstmts.nim2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim
index f1ff38b01..945bcd9e1 100644
--- a/compiler/semstmts.nim
+++ b/compiler/semstmts.nim
@@ -1779,7 +1779,9 @@ proc semStaticStmt(c: PContext, n: PNode): PNode =
   #echo "semStaticStmt"
   #writeStackTrace()
   inc c.inStaticContext
+  openScope(c)
   let a = semStmt(c, n.sons[0])
+  closeScope(c)
   dec c.inStaticContext
   n.sons[0] = a
   evalStaticStmt(c.module, c.graph, a, c.p.owner)