diff options
author | Zahary Karadjov <zahary@gmail.com> | 2014-12-31 03:50:43 +0200 |
---|---|---|
committer | Zahary Karadjov <zahary@gmail.com> | 2014-12-31 04:18:35 +0200 |
commit | b83b1383fb7dc423a812b9a6de64b9155f36d407 (patch) | |
tree | 8d1b2f35da29d2e9593cb4da6a3c6b4b4177b651 /tests | |
parent | 1b54c55b7b41f638b47a1222036ece208b99cbd3 (diff) | |
download | Nim-b83b1383fb7dc423a812b9a6de64b9155f36d407.tar.gz |
fix #1056
Diffstat (limited to 'tests')
-rw-r--r-- | tests/generics/t1056.nim | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/generics/t1056.nim b/tests/generics/t1056.nim new file mode 100644 index 000000000..73a24a76a --- /dev/null +++ b/tests/generics/t1056.nim @@ -0,0 +1,26 @@ +discard """ + output: '''TMatrix[3, 3, system.int] +3 +3''' +""" + +import typetraits + +type + TMatrix*[N,M: static[int], T] = object + data*: array[0..N*M-1, T] + + TMat2[T] = TMatrix[2,2,T] + +proc echoMatrix(a: TMatrix) = + echo a.type.name + echo TMatrix.N + +proc echoMat2(a: TMat2) = + echo TMat2.M + +var m = TMatrix[3,3,int](data: [1,2,3,4,5,6,7,8,9]) + +echoMatrix m +echoMat2 m + |