* remove unnecessary when statement * remove outdated codes * close #14581
This commit is contained in:
parent
0bb7e8dcb4
commit
3021252ad4
1 changed files with 25 additions and 0 deletions
25
tests/objvariant/t14581.nim
Normal file
25
tests/objvariant/t14581.nim
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue