summary refs log tree commit diff stats
path: root/lib/pure/asyncmacro.nim
diff options
context:
space:
mode:
authorRuslan Mustakov <endragor@users.noreply.github.com>2017-02-01 14:50:30 +0700
committerAndreas Rumpf <rumpf_a@web.de>2017-02-01 08:50:30 +0100
commit8b10609452f848a39d9c141dc96bf11d23f30eeb (patch)
treef4a71ecd64e951e2283fb1e998ba814a8ec53260 /lib/pure/asyncmacro.nim
parente88a0af494c0639c134b659ec0080b558c48e2ae (diff)
downloadNim-8b10609452f848a39d9c141dc96bf11d23f30eeb.tar.gz
Allow .async pragma on methods (#5312)
Diffstat (limited to 'lib/pure/asyncmacro.nim')
-rw-r--r--lib/pure/asyncmacro.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/pure/asyncmacro.nim b/lib/pure/asyncmacro.nim
index 2c3a09964..f74881c6d 100644
--- a/lib/pure/asyncmacro.nim
+++ b/lib/pure/asyncmacro.nim
@@ -284,9 +284,9 @@ proc getFutureVarIdents(params: NimNode): seq[NimNode] {.compileTime.} =
 proc asyncSingleProc(prc: NimNode): NimNode {.compileTime.} =
   ## This macro transforms a single procedure into a closure iterator.
   ## The ``async`` macro supports a stmtList holding multiple async procedures.
-  if prc.kind notin {nnkProcDef, nnkLambda}:
+  if prc.kind notin {nnkProcDef, nnkLambda, nnkMethodDef}:
       error("Cannot transform this node kind into an async proc." &
-            " Proc definition or lambda node expected.")
+            " proc/method definition or lambda node expected.")
 
   hint("Processing " & prc[0].getName & " as an async proc.")