make concepts tests green again

This commit is contained in:
Andreas Rumpf 2018-07-06 11:16:05 +02:00
commit 6b8167aaa1
2 changed files with 15 additions and 15 deletions

View file

@ -5,17 +5,9 @@ t3330.nim(63, 4) Error: type mismatch: got <Bar[system.int]>
but expected one of: but expected one of:
proc test(foo: Foo[int]) proc test(foo: Foo[int])
t3330.nim(48, 8) Hint: Non-matching candidates for add(k, string, T) 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 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)
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
but expression 'k' is of type: Alias but expression 'k' is of type: Alias
proc add(result: var string; x: float) proc add(result: var string; x: float)
first type mismatch at position: 1 first type mismatch at position: 1
@ -25,14 +17,22 @@ proc add(x: var string; y: cstring)
first type mismatch at position: 1 first type mismatch at position: 1
required type: var string required type: var string
but expression 'k' is of type: Alias 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 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 but expression 'k' is of type: Alias
proc add[T](x: var seq[T]; y: T) proc add[T](x: var seq[T]; y: T)
first type mismatch at position: 1 first type mismatch at position: 1
required type: var seq[T] required type: var seq[T]
but expression 'k' is of type: Alias 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(48, 8) template/generic instantiation from here
t3330.nim(55, 6) Foo: 'bar.value' cannot be assigned to t3330.nim(55, 6) Foo: 'bar.value' cannot be assigned to

View file

@ -32,7 +32,7 @@ type
data: array[M*K, T] data: array[M*K, T]
# adaptor for the concept's non-matching expectations # 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 = proc `[]`(m: MyMatrix; r, c: int): m.T =
m.data[r * m.K + c] m.data[r * m.K + c]