version 0.7.2
This commit is contained in:
parent
2cd136cf7a
commit
ddaedab835
158 changed files with 34811 additions and 10001 deletions
18
tests/tambsym2.nim
Normal file
18
tests/tambsym2.nim
Normal file
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue