summary refs log tree commit diff stats
path: root/tests/tambsym2.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2008-12-12 14:02:27 +0100
committerAndreas Rumpf <rumpf_a@web.de>2008-12-12 14:02:27 +0100
commitddaedab835fa7ea3457f21a772d636921defdc46 (patch)
tree8f96b5a3a6700704e0a64bdcdedee1d2caf68517 /tests/tambsym2.nim
parent2cd136cf7a0210e3cfde7a6f8ba32c9f09560047 (diff)
downloadNim-ddaedab835fa7ea3457f21a772d636921defdc46.tar.gz
version 0.7.2
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