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

type
  TX = Table[string, int]

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

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