close #14581 add testcase (#17169)

* remove unnecessary when statement

* remove outdated codes

* close #14581
This commit is contained in:
flywind
2021-02-24 06:49:47 -06:00
committed by GitHub
parent 0bb7e8dcb4
commit 3021252ad4

View File

@@ -0,0 +1,25 @@
discard """
matrix: "--gc:refc; --gc:arc"
output: "abc: @[(kind: A, x: 0)]"
"""
import std/tables
type E = enum
A, B
type O = object
case kind: E
of A:
x: int
of B:
y: int
proc someTable(): Table[string, seq[O]] =
result = initTable[string, seq[O]]()
result["abc"] = @[O(kind: A)]
const t = someTable()
for k, v in t:
echo k, ": ", v