make tests green again
This commit is contained in:
parent
33814cf63e
commit
fcad56c804
1 changed files with 14 additions and 14 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue