summary refs log tree commit diff stats
path: root/tests/run
diff options
context:
space:
mode:
authorZahary Karadjov <zahary@gmail.com>2012-04-10 22:32:23 +0300
committerZahary Karadjov <zahary@gmail.com>2012-04-10 22:32:23 +0300
commit97ab16d46b55aa9a4b2acbc72777fb6a8d5a162f (patch)
treea03290071c0f4788f6f3484571c1e6f4909501d1 /tests/run
parenta64f03230afa69f2143b0eb159c9294998c5e19b (diff)
downloadNim-97ab16d46b55aa9a4b2acbc72777fb6a8d5a162f.tar.gz
typetraits module and tests
Diffstat (limited to 'tests/run')
-rw-r--r--tests/run/ttypetraits.nim24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/run/ttypetraits.nim b/tests/run/ttypetraits.nim
new file mode 100644
index 000000000..5b683bef0
--- /dev/null
+++ b/tests/run/ttypetraits.nim
@@ -0,0 +1,24 @@
+discard """
+  msg:    "int\nstring\nTBar[int]"
+  output: "int\nstring\nTBar[int]"
+"""
+
+import typetraits
+
+proc foo(x) =
+  static:
+    var t = type(x)
+    echo t.name
+
+  echo x.type.name
+
+type
+  TBar[U] = object
+    x: U
+
+var bar: TBar[int]
+
+foo 10
+foo "test"
+foo bar
+