destructors: optimize more assignments into moves; also fixes #9294

This commit is contained in:
Andreas Rumpf 2018-10-12 20:36:42 +02:00
commit fcca59e415
5 changed files with 143 additions and 9 deletions

View file

@ -90,6 +90,8 @@ proc write(t: opt[Tree]) =
write stdout, it.data, "\n"
write(it.ri)
proc use(t: opt[Tree]) = discard
proc main =
var t: opt[Tree]
insert t, 60.0
@ -99,6 +101,7 @@ proc main =
write t
let copy = t
write copy
use t
main()
echo allocCount, " ", deallocCount