summary refs log tree commit diff stats
path: root/tests/vm/teval1.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/vm/teval1.nim')
-rw-r--r--tests/vm/teval1.nim26
1 files changed, 22 insertions, 4 deletions
diff --git a/tests/vm/teval1.nim b/tests/vm/teval1.nim
index 1d3a68a0d..0316ea238 100644
--- a/tests/vm/teval1.nim
+++ b/tests/vm/teval1.nim
@@ -1,3 +1,8 @@
+
+discard """
+nimout: "##"
+"""
+
 import macros
 
 proc testProc: string {.compileTime.} =
@@ -5,7 +10,7 @@ proc testProc: string {.compileTime.} =
   result = result & ""
 
 when true:
-  macro test(n: stmt): stmt {.immediate.} =
+  macro test(n: untyped): untyped =
     result = newNimNode(nnkStmtList)
     echo "#", testProc(), "#"
   test:
@@ -14,11 +19,24 @@ when true:
 const
   x = testProc()
 
-echo "##", x, "##"
+doAssert x == ""
 
 # bug #1310
 static:
-    var i, j: set[int8] = {}
-    var k = i + j
+  var i, j: set[int8] = {}
+  var k = i + j
+
+type
+  Obj = object
+    x: int
+
+converter toObj(x: int): Obj = Obj(x: x)
 
+# bug #10514
+block:
+  const
+    b: Obj = 42
+    bar = [b]
 
+  let i_runtime = 0
+  doAssert bar[i_runtime] == b