summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2019-11-20 19:08:16 +0100
committerGitHub <noreply@github.com>2019-11-20 19:08:16 +0100
commit78e02d174d0269ac9c0c6f7568405471883a78fa (patch)
tree090cf47bc367184a8295772de9fb22051d9f6d15 /tests
parentc98e0e22ad7bf7772eb0ef3f50b7f67f33ec8905 (diff)
downloadNim-78e02d174d0269ac9c0c6f7568405471883a78fa.tar.gz
fixes #12670 [backport] (#12693)
Diffstat (limited to 'tests')
-rw-r--r--tests/vm/tmisc_vm.nim20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/vm/tmisc_vm.nim b/tests/vm/tmisc_vm.nim
index 57dc526c5..a9a30568d 100644
--- a/tests/vm/tmisc_vm.nim
+++ b/tests/vm/tmisc_vm.nim
@@ -12,6 +12,9 @@ main:end
 (width: 0, height: 0, path: "")
 @[(width: 0, height: 0, path: ""), (width: 0, height: 0, path: "")]
 Done!
+foo4
+foo4
+foo4
 '''
 """
 
@@ -214,3 +217,20 @@ static:
   someTransform(state)
 
   doAssert state[1] == 13087528040916209671'u64
+
+import macros
+# bug #12670
+
+macro fooImpl(arg: untyped) =
+  result = quote do:
+    `arg`
+
+proc foo(): string {.compileTime.} =
+  fooImpl:
+    result = "foo"
+    result.addInt 4
+
+static:
+  echo foo()
+  echo foo()
+  echo foo()
8' href='#n8'>8 9 10 11 12 13 14 15 16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63