mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
Fix regression w/ templates defined in async proc
This commit is contained in:
@@ -177,7 +177,7 @@ proc processBody(node, retFutureSym: NimNode,
|
||||
var newDiscard = node
|
||||
result.createVar("futureDiscard_" & $toStrLit(node[0][1]), node[0][1],
|
||||
newDiscard[0], newDiscard, node)
|
||||
of RoutineNodes:
|
||||
of RoutineNodes-{nnkTemplateDef}:
|
||||
# skip all the nested procedure definitions
|
||||
return
|
||||
else: discard
|
||||
|
||||
11
tests/async/ttemplateinasync.nim
Normal file
11
tests/async/ttemplateinasync.nim
Normal file
@@ -0,0 +1,11 @@
|
||||
discard """
|
||||
output: 42
|
||||
"""
|
||||
|
||||
import asyncdispatch
|
||||
|
||||
proc foo(): Future[int] {.async.} =
|
||||
template ret() = return 42
|
||||
ret()
|
||||
|
||||
echo (waitFor foo())
|
||||
Reference in New Issue
Block a user