summary refs log tree commit diff stats
path: root/tests/lookups/tkoeniglookup.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lookups/tkoeniglookup.nim')
-rw-r--r--tests/lookups/tkoeniglookup.nim17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/lookups/tkoeniglookup.nim b/tests/lookups/tkoeniglookup.nim
new file mode 100644
index 000000000..8b140cceb
--- /dev/null
+++ b/tests/lookups/tkoeniglookup.nim
@@ -0,0 +1,17 @@
+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)
+
7'>97 98 99 100 101 102 103 104 105 106 107 108