summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorYuriy Glukhov <yuriy.glukhov@gmail.com>2018-06-07 19:14:14 +0300
committerYuriy Glukhov <yuriy.glukhov@gmail.com>2018-06-07 19:14:14 +0300
commit60b9c9dc1f4a45afe2813abc4234766019862549 (patch)
tree0ce1b2c3f4a3482d85c7064269897e7f103ed6a4 /tests
parentcc63351a5a44ff5793195b59d961bc93257d879d (diff)
downloadNim-60b9c9dc1f4a45afe2813abc4234766019862549.tar.gz
Fixes #7985
Diffstat (limited to 'tests')
-rw-r--r--tests/async/t7985.nim19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/async/t7985.nim b/tests/async/t7985.nim
new file mode 100644
index 000000000..0365499d3
--- /dev/null
+++ b/tests/async/t7985.nim
@@ -0,0 +1,19 @@
+discard """
+  file: "t7985.nim"
+  exitcode: 0
+  output: "(value: 1)"
+"""
+import json, asyncdispatch
+
+proc getData(): Future[JsonNode] {.async.} =
+  result = %*{"value": 1}
+
+type
+  MyData = object
+    value: BiggestInt
+
+proc main() {.async.} =
+  let data = to(await(getData()), MyData)
+  echo data
+
+waitFor(main())