summary refs log tree commit diff stats
path: root/tests/template/mdotcall.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/template/mdotcall.nim')
-rw-r--r--tests/template/mdotcall.nim22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/template/mdotcall.nim b/tests/template/mdotcall.nim
new file mode 100644
index 000000000..38a6ccae0
--- /dev/null
+++ b/tests/template/mdotcall.nim
@@ -0,0 +1,22 @@
+# issue #20073
+
+type Foo = object
+proc foo(f: Foo) = discard
+
+template works*() =
+  var f: Foo
+  foo(f)
+
+template boom*() =
+  var f: Foo
+  f.foo() # Error: attempting to call undeclared routine: 'foo'
+  f.foo # Error: undeclared field: 'foo' for type a.Foo
+
+# issue #7085
+
+proc bar(a: string): string =
+  return a & "bar"
+
+template baz*(a: string): string =
+  var b = a.bar()
+  b