This commit is contained in:
Zahary Karadjov 2014-12-31 03:50:43 +02:00
commit b83b1383fb
3 changed files with 31 additions and 2 deletions

26
tests/generics/t1056.nim Normal file
View file

@ -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