diff options
Diffstat (limited to 'tests/destructor/tarc.nim')
-rw-r--r-- | tests/destructor/tarc.nim | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/tests/destructor/tarc.nim b/tests/destructor/tarc.nim index 1acc95fad..54d75a410 100644 --- a/tests/destructor/tarc.nim +++ b/tests/destructor/tarc.nim @@ -6,7 +6,11 @@ Success Hello 1 2 -0''' +0 +List +@["4", "5", "6", "", "", "a", ""] +@["", "", "a", ""] +''' cmd: '''nim c --gc:arc $file''' """ @@ -145,3 +149,36 @@ proc bug13105 = bug13105() echo getOccupiedMem() - startMem + + +#------------------------------------------------------------------------------ +# issue #14294 + +import tables + +type + TagKind = enum + List = 0, Compound + + Tag = object + case kind: TagKind + of List: + values: seq[Tag] + of Compound: + compound: Table[string, Tag] + +var a = Tag(kind: List) +var b = a +echo a.kind +var c = a + +proc testAdd(i: int; yyy: openArray[string]) = + var x: seq[string] + x.add [$i, $(i+1), $(i+2)] + x.add yyy + echo x + +var y = newSeq[string](4) +y[2] = "a" +testAdd(4, y) +echo y |