diff options
-rw-r--r-- | tests/concepts/t3330.nim | 18 | ||||
-rw-r--r-- | tests/concepts/tmatrixconcept.nim | 6 |
2 files changed, 12 insertions, 12 deletions
diff --git a/tests/concepts/t3330.nim b/tests/concepts/t3330.nim index a4fff7fb3..78dd876e2 100644 --- a/tests/concepts/t3330.nim +++ b/tests/concepts/t3330.nim @@ -5,33 +5,33 @@ t3330.nim(63, 4) Error: type mismatch: got <Bar[system.int]> 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 + required type: var seq[T] but expression 'k' is of type: Alias -proc add(x: var string; y: char) +proc add(result: var string; x: float) first type mismatch at position: 1 required type: var string but expression 'k' is of type: Alias -proc add(result: var string; x: int64) +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(result: var string; x: float) +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(x: var string; y: cstring) +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: openArray[T]) +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[T](x: var seq[T]; y: T) +proc add(result: var string; x: int64) first type mismatch at position: 1 - required type: var seq[T] + required type: var string but expression 'k' is of type: Alias t3330.nim(48, 8) template/generic instantiation from here diff --git a/tests/concepts/tmatrixconcept.nim b/tests/concepts/tmatrixconcept.nim index d2597a212..dd5a080b6 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) |