diff options
author | Zahary Karadjov <zahary@gmail.com> | 2013-12-31 04:13:51 +0200 |
---|---|---|
committer | Zahary Karadjov <zahary@gmail.com> | 2013-12-31 04:13:51 +0200 |
commit | ed3ab6539dde803eef0c91d5b8edd58408ba86d8 (patch) | |
tree | 4a8fa23f1fc1cc175488db7f209af43cb81db481 /tests | |
parent | 8f3d5a25a692f1630bb24fbaf4951e68c9c99e28 (diff) | |
download | Nim-ed3ab6539dde803eef0c91d5b8edd58408ba86d8.tar.gz |
close #517
Diffstat (limited to 'tests')
-rw-r--r-- | tests/compile/tcompositetypeclasses.nim | 10 |
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])) + |