diff options
author | Jake Leahy <jake@leahy.dev> | 2022-12-10 12:15:45 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-10 09:15:45 +0800 |
commit | f330b33e2b1cfc72dfc1a0a7668c276ed32312e1 (patch) | |
tree | 0d75b443024c59ddfb200f82782a9471df362f99 | |
parent | db56fc3bcbc97772d6e7690f44157d1009b2a2a4 (diff) | |
download | Nim-f330b33e2b1cfc72dfc1a0a7668c276ed32312e1.tar.gz |
Use a unique name for template in async macro return (#21058)
Use unique template name
-rw-r--r-- | lib/pure/asyncmacro.nim | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/pure/asyncmacro.nim b/lib/pure/asyncmacro.nim index 1f89b15e7..fa5d981a7 100644 --- a/lib/pure/asyncmacro.nim +++ b/lib/pure/asyncmacro.nim @@ -218,13 +218,13 @@ proc asyncSingleProc(prc: NimNode): NimNode = procBody = newStmtList() let resultIdent = ident"result" procBody.add quote do: - template setResult(x: `subRetType`) {.used.} = + template nimAsyncDispatchSetResult(x: `subRetType`) {.used.} = # If the proc has implicit return then this will get called `resultIdent` = x - template setResult(x: untyped) {.used.} = + template nimAsyncDispatchSetResult(x: untyped) {.used.} = # If the proc doesn't have implicit return then this will get called x - procBody.add newCall(ident"setResult", blockStmt) + procBody.add newCall(ident"nimAsyncDispatchSetResult", blockStmt) procBody.add(createFutureVarCompletions(futureVarIdents, nil)) procBody.insert(0): quote do: {.push warning[resultshadowed]: off.} |