diff --git a/lib/pure/asyncmacro.nim b/lib/pure/asyncmacro.nim index 11eba427bd..b489e8cb57 100644 --- a/lib/pure/asyncmacro.nim +++ b/lib/pure/asyncmacro.nim @@ -46,7 +46,7 @@ template createCb(retFutureSym, iteratorNameSym, else: {.gcsafe.}: {.push hint[ConvFromXtoItselfNotNeeded]: off.} - next.callback = (proc() {.closure, gcsafe.})(identName) + next.addCallback cast[proc() {.closure, gcsafe.}](identName) {.pop.} except: futureVarCompletions