fixes a critical codegen bug triggered by .async
This commit is contained in:
parent
0c7d52e34c
commit
ffe51966b9
4 changed files with 72 additions and 52 deletions
19
tests/ccgbugs/twrong_string_asgn.nim
Normal file
19
tests/ccgbugs/twrong_string_asgn.nim
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
discard """
|
||||
output: "adf"
|
||||
"""
|
||||
|
||||
import asyncdispatch
|
||||
const
|
||||
test = ["adf"]
|
||||
|
||||
proc foo() {.async.} =
|
||||
for i in test:
|
||||
echo(i)
|
||||
|
||||
var finished = false
|
||||
let x = foo()
|
||||
x.callback =
|
||||
proc () =
|
||||
finished = true
|
||||
|
||||
while not finished: discard
|
||||
Loading…
Add table
Add a link
Reference in a new issue