Restore the docstring during the .async. transform (#10404) [backport]
Fixes #9816
This commit is contained in:
parent
226c15499f
commit
792dbed57e
1 changed files with 6 additions and 0 deletions
|
|
@ -245,6 +245,12 @@ proc asyncSingleProc(prc: NimNode): NimNode {.compileTime.} =
|
|||
|
||||
var outerProcBody = newNimNode(nnkStmtList, prc.body)
|
||||
|
||||
# Extract the documentation comment from the original procedure declaration.
|
||||
# Note that we're not removing it from the body in order not to make this
|
||||
# transformation even more complex.
|
||||
if prc.body.len > 1 and prc.body[0].kind == nnkCommentStmt:
|
||||
outerProcBody.add(prc.body[0])
|
||||
|
||||
# -> var retFuture = newFuture[T]()
|
||||
var retFutureSym = genSym(nskVar, "retFuture")
|
||||
var subRetType =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue