summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2018-10-03 18:25:25 +0200
committerLemonBoy <thatlemon@gmail.com>2018-10-03 18:25:25 +0200
commit2c0bfb34fd5c6891f8dce211c127a4fa19567c2f (patch)
tree4a368e2d04f2dc82efa1bc4184d6bde92f5bcfc1 /tests
parent91c13a0163c692dd709eed1b0cf7eee0c19d0f96 (diff)
downloadNim-2c0bfb34fd5c6891f8dce211c127a4fa19567c2f.tar.gz
Fix regression w/ templates defined in async proc
Diffstat (limited to 'tests')
-rw-r--r--tests/async/ttemplateinasync.nim11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/async/ttemplateinasync.nim b/tests/async/ttemplateinasync.nim
new file mode 100644
index 000000000..f4a2da538
--- /dev/null
+++ b/tests/async/ttemplateinasync.nim
@@ -0,0 +1,11 @@
+discard """
+  output: 42
+"""
+
+import asyncdispatch
+
+proc foo(): Future[int] {.async.} =
+  template ret() = return 42
+  ret()
+
+echo (waitFor foo())
> 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152