summary refs log tree commit diff stats
diff options
context:
space:
mode:
authordef <dennis@felsin9.de>2015-02-04 20:00:28 +0100
committerdef <dennis@felsin9.de>2015-02-04 20:00:28 +0100
commit402ada8f1d84c9a3dbdbb1bc73d8c512e97b04c3 (patch)
treed5e31b328c993255d44839e8e6960098c30433d7
parent69b794cd7dcfe553ab19ad78630d0b237c096050 (diff)
downloadNim-402ada8f1d84c9a3dbdbb1bc73d8c512e97b04c3.tar.gz
Add test for #1877
-rw-r--r--tests/static/tmatrix.nim19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/static/tmatrix.nim b/tests/static/tmatrix.nim
new file mode 100644
index 000000000..d8cc5d14d
--- /dev/null
+++ b/tests/static/tmatrix.nim
@@ -0,0 +1,19 @@
+discard """
+  output: "111"
+"""
+
+type Matrix[M,N: static[int]] = array[M, array[N, float]]
+
+let a = [[1.0,  1.0,  1.0,   1.0],
+         [2.0,  4.0,  8.0,  16.0],
+         [3.0,  9.0, 27.0,  81.0],
+         [4.0, 16.0, 64.0, 256.0]]
+
+proc `$`(m: Matrix): string =
+  result = ""
+
+proc `*`[M,N,M2,N2](a: Matrix[M,N2]; b: Matrix[M2,N]): Matrix[M,N] =
+  discard
+
+echo a * a
+