* fix #16967 [backport:1.2] * move test to tsugar
This commit is contained in:
parent
41d32c3ea3
commit
49ee2f7f3b
2 changed files with 17 additions and 1 deletions
|
|
@ -242,7 +242,7 @@ macro capture*(locals: varargs[typed], body: untyped): untyped {.since: (1, 1).}
|
|||
error("The variable name cannot be `result`!", arg)
|
||||
params.add(newIdentDefs(ident(arg.strVal), freshIdentNodes getTypeInst arg))
|
||||
result = newNimNode(nnkCall)
|
||||
result.add(newProc(newEmptyNode(), params, body, nnkProcDef))
|
||||
result.add(newProc(newEmptyNode(), params, body, nnkLambda))
|
||||
for arg in locals: result.add(arg)
|
||||
|
||||
since (1, 1):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue