diff options
author | Ruslan Mustakov <endragor@users.noreply.github.com> | 2017-02-01 14:50:30 +0700 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-02-01 08:50:30 +0100 |
commit | 8b10609452f848a39d9c141dc96bf11d23f30eeb (patch) | |
tree | f4a71ecd64e951e2283fb1e998ba814a8ec53260 /lib/pure/asyncmacro.nim | |
parent | e88a0af494c0639c134b659ec0080b558c48e2ae (diff) | |
download | Nim-8b10609452f848a39d9c141dc96bf11d23f30eeb.tar.gz |
Allow .async pragma on methods (#5312)
Diffstat (limited to 'lib/pure/asyncmacro.nim')
-rw-r--r-- | lib/pure/asyncmacro.nim | 4 |
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.") |