diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2018-02-04 07:04:50 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-02-04 07:04:50 +0100 |
commit | 326b7dc5562d3f3d2b5848723ceaeba5b8182be1 (patch) | |
tree | 21687943d41feaf38880bcd95ebcfc4e77dc44c9 /tests/concepts | |
parent | b4eff82e62883d307db83f3e875be2e1b521b0ff (diff) | |
download | Nim-326b7dc5562d3f3d2b5848723ceaeba5b8182be1.tar.gz |
improve the error messages regarding type mismatches in overloading resolution
Diffstat (limited to 'tests/concepts')
-rw-r--r-- | tests/concepts/t3330.nim | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/tests/concepts/t3330.nim b/tests/concepts/t3330.nim index bf8bffc7d..6c9883618 100644 --- a/tests/concepts/t3330.nim +++ b/tests/concepts/t3330.nim @@ -1,25 +1,48 @@ discard """ errormsg: "type mismatch: got (Bar[system.int])" nimout: ''' -t3330.nim(40, 4) Error: type mismatch: got (Bar[system.int]) +t3330.nim(63, 4) Error: type mismatch: got (Bar[system.int]) but expected one of: proc test(foo: Foo[int]) -t3330.nim(25, 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) +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 +but expression 'k' is of type: Alias 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(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]) +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) +first type mismatch at position: 1 +required type: var seq[T] +but expression 'k' is of type: Alias -t3330.nim(25, 8) template/generic instantiation from here -t3330.nim(32, 6) Foo: 'bar.value' cannot be assigned to -t3330.nim(25, 8) template/generic instantiation from here -t3330.nim(33, 6) Foo: 'bar.x' cannot be assigned to -''' +t3330.nim(48, 8) template/generic instantiation from here +t3330.nim(55, 6) Foo: 'bar.value' cannot be assigned to +t3330.nim(48, 8) template/generic instantiation from here +t3330.nim(56, 6) Foo: 'bar.x' cannot be assigned to + +expression: test(bar)''' """ + type Foo[T] = concept k add(k, string, T) |