Skip to content

Commit

Permalink
fix #9695 asyncmacro: tfuturevar fails when activated [backport: 1.0] (
Browse files Browse the repository at this point in the history
…#16090)

* fix asyncmacro

* Apply suggestions from code review

* Update lib/pure/asyncmacro.nim
  • Loading branch information
ringabout authored Nov 22, 2020
1 parent 2841cc6 commit 6f1a720
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
3 changes: 2 additions & 1 deletion lib/pure/asyncmacro.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
5 changes: 0 additions & 5 deletions tests/async/tfuturevar.nim
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
discard """
action: compile
"""
# XXX: action should be run!

import asyncdispatch

proc completeOnReturn(fut: FutureVar[string], x: bool) {.async.} =
Expand Down

0 comments on commit 6f1a720

Please sign in to comment.