Skip to content

Commit

Permalink
Fix capture for object|tuple|... types
Browse files Browse the repository at this point in the history
  • Loading branch information
Clyybber committed Feb 2, 2020
1 parent 45a5c64 commit 0b96aa7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/pure/sugar.nim
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ macro capture*(locals: openArray[typed], body: untyped): untyped {.since: (1, 1)
## echo r[0] & ", or " & r[1] # output: to be, or not to be
var params = @[newIdentNode("auto")]
for arg in locals:
params.add(newIdentDefs(ident(arg.strVal), freshIdentNodes getTypeImpl arg))
params.add(newIdentDefs(ident(arg.strVal), freshIdentNodes getTypeInst arg))
result = newNimNode(nnkCall)
result.add(newProc(newEmptyNode(), params, body, nnkProcDef))
for arg in locals: result.add(arg)
Expand Down

0 comments on commit 0b96aa7

Please sign in to comment.