Merge pull request #8995 from LemonBoy/fix-4952

Fix error during field access in VM
This commit is contained in:
Andreas Rumpf 2018-09-18 09:38:28 +02:00 • committed by GitHub
commit aa2d219afe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 3 deletions

17
tests/vm/t4952.nim Normal file
View file

@ -0,0 +1,17 @@
import macros
proc doCheck(tree: NimNode) =
let res: tuple[n: NimNode] = (n: tree)
assert: tree.kind == res.n.kind
for sub in tree:
doCheck(sub)
macro id(body: untyped): untyped =
doCheck(body)
id(foo((i: int)))
static:
let tree = newTree(nnkExprColonExpr)
let t = (n: tree)
assert: t.n.kind == tree.kind