t14581.nim 367 B

1234567891011121314151617181920212223242526
  1. discard """
  2. matrix: "--gc:refc; --gc:arc"
  3. output: "abc: @[(kind: A, x: 0)]"
  4. """
  5. import std/tables
  6. type E = enum
  7. A, B
  8. type O = object
  9. case kind: E
  10. of A:
  11. x: int
  12. of B:
  13. y: int
  14. proc someTable(): Table[string, seq[O]] =
  15. result = initTable[string, seq[O]]()
  16. result["abc"] = @[O(kind: A)]
  17. const t = someTable()
  18. for k, v in t:
  19. echo k, ": ", v