summary refs log blame commit diff stats
path: root/tests/destructor/texplicit_move.nim
blob: 93795af42816cd352ae09c564e5e96e2ea759795 (plain) (tree)
1
2
3
4
5
6
7
8
9



              



          
               













                                






                  
discard """
  output: '''3
0
0
10
destroyed!
'''
joinable: false
"""

type
  myseq* = object
    f: int

proc `=destroy`*(x: var myseq) =
  echo "destroyed!"

var
  x: myseq
x.f = 3
echo move(x.f)
echo x.f

# bug #9743
let a = create int
a[] = 10
var b = move a[]
echo a[]
echo b