mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-04 10:54:42 +00:00
Add test for #1877
This commit is contained in:
19
tests/static/tmatrix.nim
Normal file
19
tests/static/tmatrix.nim
Normal file
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user