From 97ab16d46b55aa9a4b2acbc72777fb6a8d5a162f Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Tue, 10 Apr 2012 22:32:23 +0300 Subject: typetraits module and tests --- tests/run/ttypetraits.nim | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/run/ttypetraits.nim (limited to 'tests/run') 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 + -- cgit 1.4.1-2-gfad0