parent
59d19946c0
commit
e719f211c6
4 changed files with 37 additions and 3 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue