summary refs log tree commit diff stats
path: root/tests/errmsgs/undeclared_routime3.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/errmsgs/undeclared_routime3.nim')
-rw-r--r--tests/errmsgs/undeclared_routime3.nim13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/errmsgs/undeclared_routime3.nim b/tests/errmsgs/undeclared_routime3.nim
new file mode 100644
index 000000000..052adfc08
--- /dev/null
+++ b/tests/errmsgs/undeclared_routime3.nim
@@ -0,0 +1,13 @@
+discard """
+cmd: '''nim c --hints:off $file'''
+errormsg: "undeclared field: 'bar'"
+nimout: '''undeclared_routime3.nim(13, 10) Error: undeclared field: 'bar'
+  found 'undeclared_routime3.bar()[declared in undeclared_routime3.nim(12, 9)]' of kind 'iterator'
+'''
+"""
+
+
+type Foo = object
+var a = Foo()
+iterator bar():int=discard
+let a = a.bar