summary refs log tree commit diff stats
path: root/tests/run
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2012-09-13 00:12:24 +0200
committerAraq <rumpf_a@web.de>2012-09-13 00:12:24 +0200
commit8c8400ea3aa8a785aa24127602de917c21c20ffb (patch)
treebc78ca4f77af56a74e009b641fcf64c32f45b29e /tests/run
parenteb72c7c0a0fb99d13b049de5aacb05673acc0754 (diff)
parent9e4254e4de8cecff5c0a8026930ae79b68ca7c61 (diff)
downloadNim-8c8400ea3aa8a785aa24127602de917c21c20ffb.tar.gz
Merge branch 'master' of github.com:Araq/Nimrod
Diffstat (limited to 'tests/run')
-rw-r--r--tests/run/ttypetraits.nim16
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/run/ttypetraits.nim b/tests/run/ttypetraits.nim
index 5b683bef0..cba610871 100644
--- a/tests/run/ttypetraits.nim
+++ b/tests/run/ttypetraits.nim
@@ -1,10 +1,11 @@
 discard """
   msg:    "int\nstring\nTBar[int]"
-  output: "int\nstring\nTBar[int]"
+  output: "int\nstring\nTBar[int]\nint\nrange 0..2"
 """
 
 import typetraits
 
+# simple case of type trait usage inside/outside of static blocks
 proc foo(x) =
   static:
     var t = type(x)
@@ -22,3 +23,16 @@ foo 10
 foo "test"
 foo bar
 
+# generic params on user types work too
+proc foo2[T](x: TBar[T]) =
+  echo T.name
+
+foo2 bar
+
+# less usual generic params on built-in types
+var arr: array[0..2, int] = [1, 2, 3]
+
+proc foo3[R, T](x: array[R, T]) =
+  echo name(R)
+
+foo3 arr