Closed Wh1teDuke closed 1 year ago
This issue has been automatically marked as stale because it has not had recent activity. If you think it is still a valid issue, write a comment below; otherwise it will be closed. Thank you for your contributions.
this works in current devel 3b973f3fc8a87a42b2b3855a56d87f6646fe76ac, and similar issues are closed, guess it's just reopened by adding a label.
this works in current devel https://github.com/nim-lang/Nim/commit/3b973f3fc8a87a42b2b3855a56d87f6646fe76ac, and similar issues are closed, guess it's just reopened by adding a label.
It doesn't work if the proc gets called
proc foo =
let a = 0
var b {.global.} = a # Nim should complain about this
foo()
C:\Users\blue\Documents\GitHub\Nim\test3.nim(3, 7) Hint: 'b' is declared but not used [XDeclaredButNotUsed]
CC: ../../../.choosenim/toolchains/nim-#devel/lib/system/exceptions.nim
CC: ../../../.choosenim/toolchains/nim-#devel/lib/system.nim
CC: test3.nim
C:\Users\blue\nimcache\test3_d\@mtest3.nim.c: In function 'NimMainModule':
C:\Users\blue\nimcache\test3_d\@mtest3.nim.c:229:23: error: 'a' undeclared (first use in this function)
229 | b__test51_3 = a;
| ^
hmm, seems like we need transform the lvalue to global too.
Test
Result: