Nim/tests/lookups/tkoeniglookup.nim
2014-01-13 02:10:03 +01:00

17 lines
232 B
Nim

discard """
output: '''x: 0 y: 0'''
"""
proc ToString*[T](x: T): string = return $x
type
TMyObj = object
x, y: int
proc `$`*(a: TMyObj): string =
result = "x: " & $a.x & " y: " & $a.y
var a: TMyObj
echo toString(a)