implemented generic templates
This commit is contained in:
parent
08d0003ed0
commit
6bcdb9c8f4
7 changed files with 47 additions and 26 deletions
8
tests/compile/tgenerictmpl.nim
Normal file
8
tests/compile/tgenerictmpl.nim
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
|
||||
template tmp[T](x: var seq[T]) =
|
||||
var yz: T
|
||||
x = @[1, 2, 3]
|
||||
|
||||
var y: seq[int]
|
||||
tmp(y)
|
||||
echo y.repr
|
||||
Loading…
Add table
Add a link
Reference in a new issue