diff options
author | Araq <rumpf_a@web.de> | 2017-11-29 14:52:50 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2017-11-29 14:52:50 +0100 |
commit | fcad56c804127cdf8f672a7d0810ecc17d0a0e75 (patch) | |
tree | cc23335f7209fd5fb41ff7446b5ca84b3a5588f4 /tests/specialops | |
parent | 33814cf63e9cdf3300c2d14df8f611dcb863dfaa (diff) | |
download | Nim-fcad56c804127cdf8f672a7d0810ecc17d0a0e75.tar.gz |
make tests green again
Diffstat (limited to 'tests/specialops')
-rw-r--r-- | tests/specialops/tdotops.nim | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/tests/specialops/tdotops.nim b/tests/specialops/tdotops.nim index bca949922..20066a496 100644 --- a/tests/specialops/tdotops.nim +++ b/tests/specialops/tdotops.nim @@ -23,16 +23,16 @@ type T2 = object x: int -proc `.`*(v: T1, f: string): int = - echo "reading field ", f - return v.x +template `.`*(v: T1, f: untyped): int = + echo "reading field ", astToStr(f) + v.x -proc `.=`(x: var T1, f: string{lit}, v: int) = - echo "assigning ", f, " = ", v - x.x = v +template `.=`(t: var T1, f: untyped, v: int) = + echo "assigning ", astToStr(f), " = ", v + t.x = v -template `.()`(x: T1, f: string, args: varargs[typed]): string = - echo "call to ", f +template `.()`(x: T1, f: untyped, args: varargs[typed]): string = + echo "call to ", astToStr(f) "dot call" echo "" @@ -47,13 +47,13 @@ echo t.y() var d = TD(t) assert(not compiles(d.y)) -proc `.`(v: T2, f: string): int = - echo "no params call to ", f - return v.x +template `.`(v: T2, f: untyped): int = + echo "no params call to ", astToStr(f) + v.x -proc `.`*(v: T2, f: string, a: int): int = - echo "one param call to ", f, " with ", a - return v.x +template `.`*(v: T2, f: untyped, a: int): int = + echo "one param call to ", astToStr(f), " with ", a + v.x var tt = T2(x: 100) |