summary refs log tree commit diff stats
path: root/tests/tambsym2.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tambsym2.nim')
-rw-r--r--tests/tambsym2.nim18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/tambsym2.nim b/tests/tambsym2.nim
new file mode 100644
index 000000000..9178182aa
--- /dev/null
+++ b/tests/tambsym2.nim
@@ -0,0 +1,18 @@
+# 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) = 
+  writeln(stdout, len(s))
+  
+var
+  m: TMyType
+m.len = 7
+m.data = "1234"
+
+x(m, 5) #OUT 7