summary refs log tree commit diff stats
path: root/tests/generics/tgeneric2.nim
blob: 56803017aae05c2bb60c49990a2ffed8bbdee6a2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import tables

type
  TX = TTable[string, int]

proc foo(models: seq[TX]): seq[int] =
  result = @[]
  for model in models.items:
    result.add model["foobar"]

type
  obj = object
    field: TTable[string, string]
var t: Obj
discard initTable[type(t.field), string]()