summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorZahary Karadjov <zahary@gmail.com>2017-04-16 02:44:58 +0300
committerZahary Karadjov <zahary@gmail.com>2017-04-16 02:44:58 +0300
commitdfbafff2e7cbadd28cade976520f86848a00a7c9 (patch)
treeeba804368f952a0b88bcc564da3b727bfa581fe5 /tests
parentbf4ce87e5b9e074445621716d048f2e49826585b (diff)
downloadNim-dfbafff2e7cbadd28cade976520f86848a00a7c9.tar.gz
fix a compilation error in linalg
Diffstat (limited to 'tests')
-rw-r--r--tests/generics/t5683.nim16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/generics/t5683.nim b/tests/generics/t5683.nim
index 08ec7f30d..38da52ec2 100644
--- a/tests/generics/t5683.nim
+++ b/tests/generics/t5683.nim
@@ -13,3 +13,19 @@ const
       ]
 
 echo "perm: ", a.perm, " det: ", a.det
+
+# This tests multiple instantiations of a generic
+# proc involving static params:
+type
+  Vector64*[N: static[int]] = ref array[N, float64]
+  Array64[N: static[int]] = array[N, float64]
+
+proc vector*[N: static[int]](xs: Array64[N]): Vector64[N] =
+  new result
+  for i in 0 .. < N:
+    result[i] = xs[i]
+
+let v1 = vector([1.0, 2.0, 3.0, 4.0, 5.0])
+let v2 = vector([1.0, 2.0, 3.0, 4.0, 5.0])
+let v3 = vector([1.0, 2.0, 3.0, 4.0])
+