diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/destructor/texplicit_move.nim | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/destructor/texplicit_move.nim b/tests/destructor/texplicit_move.nim new file mode 100644 index 000000000..6735ac75d --- /dev/null +++ b/tests/destructor/texplicit_move.nim @@ -0,0 +1,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 |