From 027cc5013eedce70d5f925e18037e9d1786ebd15 Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Mon, 17 Sep 2018 18:52:40 +0200 Subject: Fix error during field access in VM Tuple constructors can't have nkExprColonExpr but may contain NimNodes of that kind. Fixes #4952 --- tests/vm/t4952.nim | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/vm/t4952.nim (limited to 'tests/vm') diff --git a/tests/vm/t4952.nim b/tests/vm/t4952.nim new file mode 100644 index 000000000..fc76fa4df --- /dev/null +++ b/tests/vm/t4952.nim @@ -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 -- cgit 1.4.1-2-gfad0 tgroup> This repository contains the Nim compiler, Nim's stdlib, tools, and documentation. (mirror)ahoang <ahoang@tilde.institute>
summary refs log tree commit diff stats
path: root/tests/realtimeGC/readme.txt
blob: 17e18a5e5bcbb7b2d36400119823ec22e8b35525 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21