diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2018-09-23 16:22:31 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-09-24 16:00:57 +0200 |
commit | c38a608c9099e987a8be0149b5190a4fc2d5fb33 (patch) | |
tree | c8f86c31980f785e5bba518eaeb8f4044cbe1217 /tests/destructor/texplicit_move.nim | |
parent | 3c461755e263ecaf7810bac25adb5d6d3f4d4a28 (diff) | |
download | Nim-c38a608c9099e987a8be0149b5190a4fc2d5fb33.tar.gz |
C codegen: support system.move and system.wasMoved
Diffstat (limited to 'tests/destructor/texplicit_move.nim')
-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 |