summary refs log tree commit diff stats
path: root/tests/specialops/tdotops.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/specialops/tdotops.nim')
-rw-r--r--tests/specialops/tdotops.nim12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/specialops/tdotops.nim b/tests/specialops/tdotops.nim
index 227204f51..ca5eee665 100644
--- a/tests/specialops/tdotops.nim
+++ b/tests/specialops/tdotops.nim
@@ -1,5 +1,6 @@
 discard """
   output: '''
+
 10
 assigning z = 20
 reading field y
@@ -12,9 +13,18 @@ no params call to b
 100
 one param call to c with 10
 100
-0 4'''
+0 4
+'''
 """
 
+block:
+  type Foo = object
+  var a: Foo
+  template `.`(a: Foo, b: untyped): untyped = astToStr(b)
+  template callme(a, f): untyped = a.f
+  doAssert callme(a, f2) == "f2" # not `f`
+  doAssert a.callme(f3) == "f3"
+
 type
   T1 = object
     x*: int