diff --git a/tests/concepts/t3330.nim b/tests/concepts/t3330.nim index a4fff7fb3c..78dd876e28 100644 --- a/tests/concepts/t3330.nim +++ b/tests/concepts/t3330.nim @@ -5,17 +5,9 @@ t3330.nim(63, 4) Error: type mismatch: got but expected one of: proc test(foo: Foo[int]) t3330.nim(48, 8) Hint: Non-matching candidates for add(k, string, T) -proc add(x: var string; y: string) +proc add[T](x: var seq[T]; y: openArray[T]) first type mismatch at position: 1 - required type: var string - but expression 'k' is of type: Alias -proc add(x: var string; y: char) - first type mismatch at position: 1 - required type: var string - but expression 'k' is of type: Alias -proc add(result: var string; x: int64) - first type mismatch at position: 1 - required type: var string + required type: var seq[T] but expression 'k' is of type: Alias proc add(result: var string; x: float) first type mismatch at position: 1 @@ -25,14 +17,22 @@ proc add(x: var string; y: cstring) first type mismatch at position: 1 required type: var string but expression 'k' is of type: Alias -proc add[T](x: var seq[T]; y: openArray[T]) +proc add(x: var string; y: char) first type mismatch at position: 1 - required type: var seq[T] + required type: var string + but expression 'k' is of type: Alias +proc add(x: var string; y: string) + first type mismatch at position: 1 + required type: var string but expression 'k' is of type: Alias proc add[T](x: var seq[T]; y: T) first type mismatch at position: 1 required type: var seq[T] but expression 'k' is of type: Alias +proc add(result: var string; x: int64) + first type mismatch at position: 1 + required type: var string + but expression 'k' is of type: Alias t3330.nim(48, 8) template/generic instantiation from here t3330.nim(55, 6) Foo: 'bar.value' cannot be assigned to diff --git a/tests/concepts/tmatrixconcept.nim b/tests/concepts/tmatrixconcept.nim index d2597a2122..dd5a080b6d 100644 --- a/tests/concepts/tmatrixconcept.nim +++ b/tests/concepts/tmatrixconcept.nim @@ -32,7 +32,7 @@ type data: array[M*K, T] # adaptor for the concept's non-matching expectations -template N(M: type MyMatrix): expr = M.K +template N(M: type MyMatrix): untyped = M.K proc `[]`(m: MyMatrix; r, c: int): m.T = m.data[r * m.K + c] @@ -45,7 +45,7 @@ proc foo(x: MyMatrix, arr: array[15, x.T]) = discard proc genericMatrixProc[R, C, TE, FF, FC, T](m: Matrix[R, C, TE, FF, FC, T]): T = static: echo "R=", R, " C=", C, " TE=", TE, " FF=", FF, " FC=", FC, " T=", T.name - + m[0, 0] proc implicitMatrixProc(m: Matrix): m.T = @@ -57,7 +57,7 @@ proc implicitMatrixProc(m: Matrix): m.T = #" FF=", m.FromFoo, #" FC=", m.FromConst, " T=", m.T.name - + m[0, 0] proc myMatrixProc(x: MyMatrix): MyMatrix.T = genericMatrixProc(x)