summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorZahary Karadjov <zahary@gmail.com>2013-12-31 04:13:51 +0200
committerZahary Karadjov <zahary@gmail.com>2013-12-31 04:13:51 +0200
commited3ab6539dde803eef0c91d5b8edd58408ba86d8 (patch)
tree4a8fa23f1fc1cc175488db7f209af43cb81db481 /tests
parent8f3d5a25a692f1630bb24fbaf4951e68c9c99e28 (diff)
downloadNim-ed3ab6539dde803eef0c91d5b8edd58408ba86d8.tar.gz
close #517
Diffstat (limited to 'tests')
-rw-r--r--tests/compile/tcompositetypeclasses.nim10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/compile/tcompositetypeclasses.nim b/tests/compile/tcompositetypeclasses.nim
index 4ba92fed1..3e6f0d6ae 100644
--- a/tests/compile/tcompositetypeclasses.nim
+++ b/tests/compile/tcompositetypeclasses.nim
@@ -33,3 +33,13 @@ accept baz(vbaz)
 reject baz(vnotbaz)
 reject bar(vfoo)
 
+# https://github.com/Araq/Nimrod/issues/517
+type
+  TVecT*[T] = array[0..1, T]|array[0..2, T]|array[0..3, T]
+  TVec2* = array[0..1, float32]
+
+proc f[T](a: TVecT[T], b: TVecT[T]): T = discard
+
+var x: float = f([0.0'f32, 0.0'f32], [0.0'f32, 0.0'f32])
+var y = f(TVec2([0.0'f32, 0.0'f32]), TVec2([0.0'f32, 0.0'f32]))
+