tests and docs for call operator (#16980)
* tests and docs for call operator * fix leftover * add extra dot test
This commit is contained in:
parent
d1210a3bb9
commit
aac8f67573
4 changed files with 124 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue