improve the error messages regarding type mismatches in overloading resolution
This commit is contained in:
parent
b4eff82e62
commit
326b7dc556
4 changed files with 74 additions and 11 deletions
22
tests/errmsgs/tdetailed_position.nim
Normal file
22
tests/errmsgs/tdetailed_position.nim
Normal 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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue