summary refs log blame commit diff stats
path: root/tests/run/tkoeniglookup.nim
blob: e6f5c0112cbbb04a116cf61d6e54faedfe1c7a07 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11










                                           

                                       



                
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)