You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm refactoring https://github.com/unicredit/linear-algebra/ and creating a generic Matrix[M, N, T] of which Matrix32[M, N] and Matrix64[M, N] will be subset to maintain backward compatibility.
I got a strange error on clang with the following test case
typeMatrix*[M, N: static[int], T: SomeReal] =object
data: refarray[N * M, T]
Matrix64*[M, N: static[int]] =Matrix[M, N, float64]
proczeros64(M,N: static[int]): Matrix64[M,N] =newresult.data
for i in0..< (M * N):
result.data[i] =0'f64proc`$`*[M, N: static[int]](m: Matrix64[M, N]): string=result="64"procfoo*[M,N: static[int], T](a: Matrix[M,N,T]) =echo a
procbar*[M,N: static[int], T](a: Matrix[M,N,T], b: Matrix[M,N,T]) =echo a
let a =zeros64(2,2)
foo(a) #worksbar(a,a) #fails
Error is
Hint: used config file '/usr/local/Cellar/nim/HEAD-7e351fc/nim/config/nim.cfg' [Conf]
Hint: system [Processing]
Hint: playground2 [Processing]
CC: linalg_playground2
Error: execution of an external compiler program 'clang -c -w -I/usr/local/Cellar/nim/HEAD-7e351fc/nim/lib -o nimcache/linalg_playground2.o nimcache/linalg_playground2.c' failed with exit code: 1
nimcache/linalg_playground2.c:260:57: error: passing 'Matrix_Nb9aIVumBEh1lQnIqrfOM9ag' (aka 'struct Matrix_Nb9aIVumBEh1lQnIqrfOM9ag') to parameter of incompatible type 'Matrix_t9aff0BJYnei5m71SWTA5Wg' (aka 'struct Matrix_t9aff0BJYnei5m71SWTA5Wg')
bar_dxw2HPX6uLOVcW9bsla0gNA(a_UlQDd4uj9bxnRSukXNrxCBQ, a_UlQDd4uj9bxnRSukXNrxCBQ);
^~~~~~~~~~~~~~~~~~~~~~~~~
nimcache/linalg_playground2.c:200:112: note: passing argument to parameter 'b' here
N_NIMCALL(void, bar_dxw2HPX6uLOVcW9bsla0gNA)(Matrix_Nb9aIVumBEh1lQnIqrfOM9ag a, Matrix_t9aff0BJYnei5m71SWTA5Wg b) {
^
1 error generated.
The text was updated successfully, but these errors were encountered:
I'm refactoring https://github.com/unicredit/linear-algebra/ and creating a generic Matrix[M, N, T] of which Matrix32[M, N] and Matrix64[M, N] will be subset to maintain backward compatibility.
I got a strange error on clang with the following test case
Error is
The text was updated successfully, but these errors were encountered: