summary refs log tree commit diff stats
path: root/tests/vm/teval1.nim
diff options
context:
space:
mode:
authorClyybber <darkmine956@gmail.com>2019-09-28 19:50:20 +0200
committerAndreas Rumpf <rumpf_a@web.de>2019-09-28 19:50:20 +0200
commit85db42ad8c1a19ea47bd5826d8639e8974cc9042 (patch)
tree5d00473b4dbf1caeacddcc8a0b14467523c5e630 /tests/vm/teval1.nim
parent5a65243e14773fc0d96bfd70429056dc5161df7f (diff)
downloadNim-85db42ad8c1a19ea47bd5826d8639e8974cc9042.tar.gz
Fixes #10514 (#12268)
* Fixes #10514

(cherry picked from commit f6f789bb4db2a367384ba6ad75706edd503de1f8)

* Add comment

* Add changelog entry
Diffstat (limited to 'tests/vm/teval1.nim')
-rw-r--r--tests/vm/teval1.nim15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/vm/teval1.nim b/tests/vm/teval1.nim
index 5c323f0e7..0316ea238 100644
--- a/tests/vm/teval1.nim
+++ b/tests/vm/teval1.nim
@@ -25,3 +25,18 @@ doAssert x == ""
 static:
   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