summary refs log tree commit diff stats
path: root/tests/async/tnimcall_to_closure.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-01-11 11:11:44 +0100
committerAndreas Rumpf <rumpf_a@web.de>2016-01-11 11:11:44 +0100
commit5be6c95d217c1d86ad4288ea58b0c4c6ee3ffe90 (patch)
tree2b2346aaec130d04d7e065f873b870cf373f40df /tests/async/tnimcall_to_closure.nim
parent0844941b35d22093861a42cb4d3070a1f54f7896 (diff)
downloadNim-5be6c95d217c1d86ad4288ea58b0c4c6ee3ffe90.tar.gz
fixes async regression
Diffstat (limited to 'tests/async/tnimcall_to_closure.nim')
-rw-r--r--tests/async/tnimcall_to_closure.nim17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/async/tnimcall_to_closure.nim b/tests/async/tnimcall_to_closure.nim
new file mode 100644
index 000000000..748b67cb1
--- /dev/null
+++ b/tests/async/tnimcall_to_closure.nim
@@ -0,0 +1,17 @@
+
+import asyncdispatch
+
+proc defaultOnProgressChanged() = discard
+
+proc ask(x: proc()) = x()
+
+proc retrFile*(onProgressChanged: proc() {.nimcall.}): Future[void] =
+  var retFuture = newFuture[void]("retrFile")
+  iterator retrFileIter(): FutureBase {.closure.} =
+    ask(onProgressChanged)
+    complete(retFuture)
+
+  var nameIterVar = retrFileIter
+  return retFuture
+
+discard retrFile(defaultOnProgressChanged)