From fcad56c804127cdf8f672a7d0810ecc17d0a0e75 Mon Sep 17 00:00:00 2001 From: Araq Date: Wed, 29 Nov 2017 14:52:50 +0100 Subject: make tests green again --- tests/specialops/tdotops.nim | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'tests/specialops') 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) -- cgit 1.4.1-2-gfad0