make tests green again

This commit is contained in:
Araq 2017-11-29 14:52:50 +01:00
commit fcad56c804

View file

@ -23,16 +23,16 @@ type
T2 = object T2 = object
x: int x: int
proc `.`*(v: T1, f: string): int = template `.`*(v: T1, f: untyped): int =
echo "reading field ", f echo "reading field ", astToStr(f)
return v.x v.x
proc `.=`(x: var T1, f: string{lit}, v: int) = template `.=`(t: var T1, f: untyped, v: int) =
echo "assigning ", f, " = ", v echo "assigning ", astToStr(f), " = ", v
x.x = v t.x = v
template `.()`(x: T1, f: string, args: varargs[typed]): string = template `.()`(x: T1, f: untyped, args: varargs[typed]): string =
echo "call to ", f echo "call to ", astToStr(f)
"dot call" "dot call"
echo "" echo ""
@ -47,13 +47,13 @@ echo t.y()
var d = TD(t) var d = TD(t)
assert(not compiles(d.y)) assert(not compiles(d.y))
proc `.`(v: T2, f: string): int = template `.`(v: T2, f: untyped): int =
echo "no params call to ", f echo "no params call to ", astToStr(f)
return v.x v.x
proc `.`*(v: T2, f: string, a: int): int = template `.`*(v: T2, f: untyped, a: int): int =
echo "one param call to ", f, " with ", a echo "one param call to ", astToStr(f), " with ", a
return v.x v.x
var tt = T2(x: 100) var tt = T2(x: 100)