From 0b96aa773b1649235a48538adf6fa3c80a2cf3a6 Mon Sep 17 00:00:00 2001 From: Clyybber Date: Sun, 2 Feb 2020 01:51:44 +0100 Subject: [PATCH] Fix capture for object|tuple|... types --- lib/pure/sugar.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pure/sugar.nim b/lib/pure/sugar.nim index 5719e8dd77f1..fa28ffcf47cf 100644 --- a/lib/pure/sugar.nim +++ b/lib/pure/sugar.nim @@ -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)