Make static blocks introduce their own scope

Treat the static block as a normal block, don't leak any identifier in
the outer scope.

Fixes #5958
This commit is contained in:
LemonBoy 2018-06-24 18:27:40 +02:00
commit 9543689306
2 changed files with 11 additions and 0 deletions

9
tests/global/t5958.nim Normal file
View file

@ -0,0 +1,9 @@
discard """
line: 9
errormsg: "undeclared identifier: 'a'"
"""
static:
var a = 1
echo a