Files
Nim/tests/lookups/tkoeniglookup.nim
Adam Strzelecki e80465dacf tests: Trim .nim files trailing whitespace
via OSX: find . -name '*.nim' -exec sed -i '' -E 's/[[:space:]]+$//' {} +
2015-09-04 23:04:32 +02:00

18 lines
231 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)