Fix compileTime pragma applying to whole var/let section (#10389)
This commit is contained in:
parent
44c04b3571
commit
226c15499f
2 changed files with 19 additions and 6 deletions
15
tests/vm/tvarsection.nim
Normal file
15
tests/vm/tvarsection.nim
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
discard """
|
||||
output: '''-1abc'''
|
||||
"""
|
||||
|
||||
var
|
||||
a {.compileTime.} = 2
|
||||
b = -1
|
||||
c {.compileTime.} = 3
|
||||
d = "abc"
|
||||
|
||||
static:
|
||||
assert a == 2
|
||||
assert c == 3
|
||||
|
||||
echo b, d
|
||||
Loading…
Add table
Add a link
Reference in a new issue