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:
parent
105a472dc5
commit
9543689306
2 changed files with 11 additions and 0 deletions
9
tests/global/t5958.nim
Normal file
9
tests/global/t5958.nim
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
discard """
|
||||
line: 9
|
||||
errormsg: "undeclared identifier: 'a'"
|
||||
"""
|
||||
|
||||
static:
|
||||
var a = 1
|
||||
|
||||
echo a
|
||||
Loading…
Add table
Add a link
Reference in a new issue