From 8b10609452f848a39d9c141dc96bf11d23f30eeb Mon Sep 17 00:00:00 2001 From: Ruslan Mustakov Date: Wed, 1 Feb 2017 14:50:30 +0700 Subject: [PATCH] Allow .async pragma on methods (#5312) --- lib/pure/asyncmacro.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pure/asyncmacro.nim b/lib/pure/asyncmacro.nim index 2c3a099648..f74881c6d0 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.")