overloading of '=' works
This commit is contained in:
parent
78f371c03a
commit
05e39cf6ad
9 changed files with 147 additions and 6 deletions
22
tests/assign/toverload_asgn2.nim
Normal file
22
tests/assign/toverload_asgn2.nim
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
discard """
|
||||
output: '''i value 88
|
||||
2aa'''
|
||||
"""
|
||||
|
||||
import moverload_asgn2
|
||||
|
||||
proc passAround(i: int): Concrete =
|
||||
echo "i value ", i
|
||||
result = Concrete(a: "aa", b: "bb", rc: 0)
|
||||
|
||||
proc main =
|
||||
let
|
||||
i = 88
|
||||
v = passAround(i)
|
||||
z = v.a
|
||||
var
|
||||
x: Concrete
|
||||
x = v
|
||||
echo x.rc, z # 2aa
|
||||
|
||||
main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue