# like unsurprisingly this doesn't work: import std/[macros, asyncdispatch] proc dep(x: var int) {.async.} = x = 9 echo x macro toTyped(x: typed): untyped = x proc processTypedAst(x: NimNode) = echo treeRepr(x) macro st1(x: untyped): untyped = processTypedAst(toTyped(x)) x proc p() {.st1, async.} = var d = 5 await dep(d) echo "result: ", d waitFor p()