re-enable semistatic[T] as a test case
This commit is contained in:
parent
b21b72dc14
commit
5b32fb1791
1 changed files with 7 additions and 1 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue