fix #20866 [ORC] Bad codegen for global pointer to iterator (#20876)

This commit is contained in:
Bung 2022-11-23 03:05:16 +08:00 • committed by GitHub
commit 354eb2a86c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 3 deletions

View file

@ -4,7 +4,7 @@ action: "reject"
nimout: '''
t3505.nim(22, 22) Error: cannot assign local to global variable
t3505.nim(31, 28) Error: cannot assign local to global variable
t3505.nim(39, 29) Error: cannot assign local to global variable
@ -31,3 +31,11 @@ proc main() =
var x {.global.} = initX2(initX(f))
main()
# issue #20866
proc foo2() =
iterator bar() {.closure.} =
discard
var g {.global.} = rawProc(bar)
foo2()