honor --declaredLocs in more places, including type mismatch errors; also show kind with --declaredLocs (#15673)

* honor --declaredLocs in more places, including type mismatch errors
* fix tests
* show declaration location also when type mismatch names clash
This commit is contained in:
Timothee Cour 2020-10-27 15:19:28 +02:00 • committed by GitHub
commit 0fb878324e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 40 additions and 24 deletions

View file

@ -2,7 +2,7 @@ discard """
cmd: "nim check $options $file"
errormsg: ""
nimout: '''
t8794.nim(39, 27) Error: undeclared field: 'a3' for type m8794.Foo3 [declared in m8794.nim(1, 6)]
t8794.nim(39, 27) Error: undeclared field: 'a3' for type m8794.Foo3 [type declared in m8794.nim(1, 6)]
'''
"""

View file

@ -2,8 +2,8 @@ discard """
cmd: '''nim c --hints:off $file'''
errormsg: "attempting to call routine: 'myiter'"
nimout: '''undeclared_routime.nim(13, 15) Error: attempting to call routine: 'myiter'
found 'undeclared_routime.myiter(a: string)[declared in undeclared_routime.nim(10, 9)]' of kind 'iterator'
found 'undeclared_routime.myiter()[declared in undeclared_routime.nim(11, 9)]' of kind 'iterator'
found 'undeclared_routime.myiter(a: string)[iterator declared in undeclared_routime.nim(10, 9)]'
found 'undeclared_routime.myiter()[iterator declared in undeclared_routime.nim(11, 9)]'
'''
"""

View file

@ -1,6 +1,6 @@
discard """
nimout: '''
found 'a' of kind 'var'
found 'a' [var declared in tnoop.nim(11, 3)]
'''
file: "tnoop.nim"
line: 13