summary refs log tree commit diff stats
path: root/tests/ccgbugs/twrong_string_asgn.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2015-09-10 08:32:39 +0200
committerAraq <rumpf_a@web.de>2015-09-10 10:50:29 +0200
commitffe51966b9a424a55a0a6c5ccac37fe0ced3709f (patch)
tree2cbd10e4208e4c138462394793c90c9450decba2 /tests/ccgbugs/twrong_string_asgn.nim
parent0c7d52e34ccf69a1b1d7ab6fb15e36ca53e9864b (diff)
downloadNim-ffe51966b9a424a55a0a6c5ccac37fe0ced3709f.tar.gz
fixes a critical codegen bug triggered by .async
Diffstat (limited to 'tests/ccgbugs/twrong_string_asgn.nim')
-rw-r--r--tests/ccgbugs/twrong_string_asgn.nim19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/ccgbugs/twrong_string_asgn.nim b/tests/ccgbugs/twrong_string_asgn.nim
new file mode 100644
index 000000000..b62e70e7c
--- /dev/null
+++ b/tests/ccgbugs/twrong_string_asgn.nim
@@ -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