summary refs log tree commit diff stats
path: root/tests/lookups/tambsym2.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lookups/tambsym2.nim')
-rw-r--r--tests/lookups/tambsym2.nim21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/lookups/tambsym2.nim b/tests/lookups/tambsym2.nim
new file mode 100644
index 000000000..747f1a086
--- /dev/null
+++ b/tests/lookups/tambsym2.nim
@@ -0,0 +1,21 @@
+discard """
+  output: "7"
+"""
+# Test overloading of procs with locals
+
+type
+  TMyType = object
+    len: int
+    data: string
+
+proc len(x: TMyType): int {.inline.} = return x.len
+
+proc x(s: TMyType, len: int) =
+  writeLine(stdout, len(s))
+
+var
+  m: TMyType
+m.len = 7
+m.data = "1234"
+
+x(m, 5) #OUT 7