re-enable semistatic[T] as a test case

This commit is contained in:
Zahary Karadjov 2015-01-02 17:51:52 +02:00
commit 5b32fb1791

View file

@ -1,9 +1,15 @@
discard """ discard """
msg: "static 10\ndynamic\nstatic 20\n" msg: "static 10\ndynamic\nstatic 20\n"
output: "s\nd\nd\ns" output: "s\nd\nd\ns"
disabled: "true"
""" """
type
semistatic[T] =
static[T] or T
template isStatic*(x): expr =
compiles(static(x))
proc foo(x: semistatic[int]) = proc foo(x: semistatic[int]) =
when isStatic(x): when isStatic(x):
static: echo "static ", x static: echo "static ", x