fixes #8671; show helpful msg (lookup symbol, eg iterator) on 'attempting to call undeclared routine' error (#8786)
This commit is contained in:
parent
8232bd04f9
commit
eb946f37a7
10 changed files with 98 additions and 10 deletions
13
tests/errmsgs/undeclared_routime.nim
Normal file
13
tests/errmsgs/undeclared_routime.nim
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
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'
|
||||
'''
|
||||
"""
|
||||
|
||||
iterator myiter(a:string): int = discard
|
||||
iterator myiter(): int = discard
|
||||
|
||||
let a = myiter(1)
|
||||
Loading…
Add table
Add a link
Reference in a new issue