diff options
author | hlaaftana <10591326+hlaaftana@users.noreply.github.com> | 2021-02-09 14:18:16 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-09 12:18:16 +0100 |
commit | aac8f675732086e9573851765d6e1c5b9ff38c28 (patch) | |
tree | dc934d291fba2d73370723d1b21c8b53d03a3ca1 /tests/specialops/tdotops.nim | |
parent | d1210a3bb9fb381c42e3f6070f1011dcf7178d29 (diff) | |
download | Nim-aac8f675732086e9573851765d6e1c5b9ff38c28.tar.gz |
tests and docs for call operator (#16980)
* tests and docs for call operator * fix leftover * add extra dot test
Diffstat (limited to 'tests/specialops/tdotops.nim')
-rw-r--r-- | tests/specialops/tdotops.nim | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/specialops/tdotops.nim b/tests/specialops/tdotops.nim index b1c75ab33..ca5eee665 100644 --- a/tests/specialops/tdotops.nim +++ b/tests/specialops/tdotops.nim @@ -17,6 +17,14 @@ one param call to c with 10 ''' """ +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 |