improve the error messages regarding type mismatches in overloading resolution

This commit is contained in:
Andreas Rumpf 2018-02-04 07:04:50 +01:00
commit 326b7dc556
4 changed files with 74 additions and 11 deletions

View file

@ -0,0 +1,22 @@
discard """
cmd: "nim check $file"
errormsg: "type mismatch: got (int literal(1), int literal(2), int literal(3))"
nimout: '''
but expected one of:
proc main(a, b, c: string)
first type mismatch at position: 1
required type: string
but expression '1' is of type: int literal(1)
expression: main(1, 2, 3)
'''
"""
const
myconst = "abcdefghijklmnopqrstuvwxyz"
proc main(a, b, c: string) {.deprecated: "use foo " & "instead " & myconst.} =
return
main(1, 2, 3)