mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-31 02:12:11 +00:00
Restore the docstring during the .async. transform (#10404) [backport]
Fixes #9816
This commit is contained in:
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user