Files
Nim/tests/template/tgenerictemplates.nim
2017-05-13 20:48:44 +03:00

14 lines
230 B
Nim

type
SomeObj = object of RootObj
Foo[T, U] = object
x: T
y: U
template someTemplate[T](): tuple[id: int32, obj: T] =
var result: tuple[id: int32, obj: T] = (0'i32, T())
result
let ret = someTemplate[SomeObj]()