summary refs log tree commit diff stats
path: root/tests/errmsgs/undeclared_routime.nim
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2018-10-13 16:16:04 -0700
committerAndreas Rumpf <rumpf_a@web.de>2018-10-14 01:16:04 +0200
commiteb946f37a7c56fb64703357a67ed098ac8dfd936 (patch)
tree87c87454fad5a77a13b8db7d05a37222bdb030ec /tests/errmsgs/undeclared_routime.nim
parent8232bd04f9edc4b3accb114c9bd6e60190b68396 (diff)
downloadNim-eb946f37a7c56fb64703357a67ed098ac8dfd936.tar.gz
fixes #8671; show helpful msg (lookup symbol, eg iterator) on 'attempting to call undeclared routine' error (#8786)
Diffstat (limited to 'tests/errmsgs/undeclared_routime.nim')
-rw-r--r--tests/errmsgs/undeclared_routime.nim13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/errmsgs/undeclared_routime.nim b/tests/errmsgs/undeclared_routime.nim
new file mode 100644
index 000000000..426507652
--- /dev/null
+++ b/tests/errmsgs/undeclared_routime.nim
@@ -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)