diff options
author | Zahary Karadjov <zahary@gmail.com> | 2013-12-25 22:40:06 +0200 |
---|---|---|
committer | Zahary Karadjov <zahary@gmail.com> | 2013-12-25 22:40:06 +0200 |
commit | 86108be24b43d1b4b02a6549e75f64b7625233ac (patch) | |
tree | 419e23e4a039dfc603cb224c858d583fa38ae8a4 | |
parent | edab4aaad02bf414f7f0c6e3148ade8a7b485c40 (diff) | |
download | Nim-86108be24b43d1b4b02a6549e75f64b7625233ac.tar.gz |
test case for semistatic
-rw-r--r-- | tests/run/tsemistatic.nim | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/run/tsemistatic.nim b/tests/run/tsemistatic.nim new file mode 100644 index 000000000..d187f153c --- /dev/null +++ b/tests/run/tsemistatic.nim @@ -0,0 +1,24 @@ +discard """ + msg: "static 10\ndynamic\nstatic 20\n" + output: "s\nd\nd\ns" +""" + +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 + |