This commit is contained in:
Zahary Karadjov 2018-06-14 12:47:07 +03:00
commit e719f211c6
4 changed files with 37 additions and 3 deletions

View file

@ -1,3 +1,11 @@
discard """
output: "1\n10\n1\n10"
nimout: '''
bar instantiated with 1
bar instantiated with 10
'''
"""
import typetraits
type
@ -122,3 +130,16 @@ when true:
var p = getOrigin[float]()
var rotated = p.rotate(2.1)
test 7:
proc bar(x: static[int]) =
static: echo "bar instantiated with ", x
echo x
proc foo(x: static[int] = 1) =
bar(x)
foo()
foo(10)
foo(1)
foo(10)