diff options
author | LemonBoy <thatlemon@gmail.com> | 2018-06-24 18:27:40 +0200 |
---|---|---|
committer | LemonBoy <thatlemon@gmail.com> | 2018-06-24 18:27:40 +0200 |
commit | 95436893061176d51b1c11fdf5418b3ed17a8455 (patch) | |
tree | 7da71a2d383c24a9fe9c6c4abc4e2630c34f1c95 /tests/global/t5958.nim | |
parent | 105a472dc5eb239c68d7e13d8eef93c8dc0311be (diff) | |
download | Nim-95436893061176d51b1c11fdf5418b3ed17a8455.tar.gz |
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
Diffstat (limited to 'tests/global/t5958.nim')
-rw-r--r-- | tests/global/t5958.nim | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/global/t5958.nim b/tests/global/t5958.nim new file mode 100644 index 000000000..5abcad4a9 --- /dev/null +++ b/tests/global/t5958.nim @@ -0,0 +1,9 @@ +discard """ + line: 9 + errormsg: "undeclared identifier: 'a'" +""" + +static: + var a = 1 + +echo a |