summary refs log tree commit diff stats
path: root/tests/destructor/texplicit_move.nim
blob: 6735ac75dbc23eac3d6565d203cf3fa1d793579a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
discard """
  output: '''3
0
destroyed!'''
"""

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