fixes #15122 [backport:1.2] (#15139)

This commit is contained in:
Andreas Rumpf 2020-08-01 13:16:50 +02:00 • committed by GitHub
commit 9ff2c50155
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 0 deletions

View file

@ -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"