Nim/tests/metatype/tsemistatic.nim
2014-12-15 02:15:11 +01:00

25 lines
295 B
Nim

discard """
msg: "static 10\ndynamic\nstatic 20\n"
output: "s\nd\nd\ns"
disabled: "true"
"""
proc foo(x: semistatic[int]) =
when isStatic(x):
static: echo "static ", x
echo "s"
else:
static: echo "dynamic"
echo "d"
foo 10
var
x = 10
y: int
foo x
foo y
foo 20