fix #9695 asyncmacro: tfuturevar fails when activated [backport: 1.0] (#16090)

* fix asyncmacro

* Apply suggestions from code review

* Update lib/pure/asyncmacro.nim
This commit is contained in:
flywind
2020-11-23 00:16:42 +08:00
committed by GitHub
parent 2841cc6e97
commit 6f1a72069a
2 changed files with 2 additions and 6 deletions

View File

@@ -118,7 +118,8 @@ proc getFutureVarIdents(params: NimNode): seq[NimNode] {.compileTime.} =
for i in 1 ..< len(params):
expectKind(params[i], nnkIdentDefs)
if params[i][1].kind == nnkBracketExpr and
params[i][1][0].eqIdent("futurevar"):
params[i][1][0].eqIdent(FutureVar.astToStr):
## eqIdent: first char is case sensitive!!!
result.add(params[i][0])
proc isInvalidReturnType(typeName: string): bool =

View File

@@ -1,8 +1,3 @@
discard """
action: compile
"""
# XXX: action should be run!
import asyncdispatch
proc completeOnReturn(fut: FutureVar[string], x: bool) {.async.} =