summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorZahary Karadjov <zahary@gmail.com>2015-01-02 19:19:18 +0200
committerZahary Karadjov <zahary@gmail.com>2015-01-02 23:58:24 +0200
commit1d5ecc0deac508e7ebb3bf9df01aa34d5025d83d (patch)
treea8d4566f5a39dc53a3b229226e4ba613463ea066 /tests
parentaa69a8a09f990f485e4ae7058b15067c70e70e28 (diff)
downloadNim-1d5ecc0deac508e7ebb3bf9df01aa34d5025d83d.tar.gz
fix #1050
Diffstat (limited to 'tests')
-rw-r--r--tests/generics/t1050.nim16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/generics/t1050.nim b/tests/generics/t1050.nim
new file mode 100644
index 000000000..a6f9a2482
--- /dev/null
+++ b/tests/generics/t1050.nim
@@ -0,0 +1,16 @@
+discard """
+  msg: "int"
+  output: "4"
+"""
+
+import typetraits
+
+type ArrayType[T] = distinct T
+
+proc arrayItem(a: ArrayType): auto =
+  static: echo(name(type(a).T))
+  result = (type(a).T)(4)
+
+var arr: ArrayType[int]
+echo arrayItem(arr)
+