Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nimscript does not have {.global.}? #19502

Open
dev-pts opened this issue Feb 7, 2022 · 0 comments
Open

nimscript does not have {.global.}? #19502

dev-pts opened this issue Feb 7, 2022 · 0 comments

Comments

@dev-pts
Copy link

dev-pts commented Feb 7, 2022

This code:

proc test =
    var idx {.global.} = 0
    echo idx
    idx += 1

test()
test()

gives different results depending on how to execute it:

# nim e test.nim
0
0
# nim r test.nim
0
1

Tested on 1.6.2 and latest git revision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants