summary refs log tree commit diff stats
path: root/tests/arc/tarcmisc.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2020-08-01 13:16:50 +0200
committerGitHub <noreply@github.com>2020-08-01 13:16:50 +0200
commit9ff2c50155ca172e2decb0b66ee78b50af3ff51f (patch)
treef4cba90425293101bcf6e476983a5ce10ca2407a /tests/arc/tarcmisc.nim
parente192e07bf0ac790bcb0b95ee63e62fce688ab40c (diff)
downloadNim-9ff2c50155ca172e2decb0b66ee78b50af3ff51f.tar.gz
fixes #15122 [backport:1.2] (#15139)
Diffstat (limited to 'tests/arc/tarcmisc.nim')
-rw-r--r--tests/arc/tarcmisc.nim28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/arc/tarcmisc.nim b/tests/arc/tarcmisc.nim
index a7f2dd98b..542e4f316 100644
--- a/tests/arc/tarcmisc.nim
+++ b/tests/arc/tarcmisc.nim
@@ -319,3 +319,31 @@ proc createMachine =
     echo machine.factory().hello
 
 createMachine()
+
+# bug #15122
+
+import tables
+
+type
+  BENodeKind = enum
+    tkBytes,
+    tkList,
+    tkDict
+
+  BENode = object
+    case kind: BENodeKind
+    of tkBytes: strVal: string
+    of tkList: listVal: seq[BENode]
+    of tkDict: dictVal: Table[string, BENode]
+
+var data = {
+  "examples": {
+    "values": BENode(
+      kind: tkList,
+      listVal: @[BENode(kind: tkBytes, strVal: "test")]
+    )
+  }.toTable()
+}.toTable()
+
+# For ARC listVal is empty for some reason
+doAssert data["examples"]["values"].listVal[0].strVal == "test"