C codegen: support system.move and system.wasMoved

This commit is contained in:
Andreas Rumpf 2018-09-23 16:22:31 +02:00
commit c38a608c90
2 changed files with 38 additions and 0 deletions

View file

@ -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