more progress on destructors; removed old destructor based code as it proved confusing

This commit is contained in:
Araq 2017-12-01 01:52:00 +01:00
commit fa92c519aa
9 changed files with 152 additions and 270 deletions

View file

@ -20,10 +20,10 @@ myobj destroyed
----
myobj destroyed
'''
cmd: '''nim c --newruntime $file'''
disabled: "true"
"""
{.experimental.}
type
TMyObj = object
x, y: int
@ -61,7 +61,7 @@ proc `=destroy`(o: var TMyObj) =
if o.p != nil: dealloc o.p
echo "myobj destroyed"
proc `=destroy`(o: var TMyGeneric1) =
proc `=destroy`(o: var TMyGeneric1[int]) =
echo "mygeneric1 destroyed"
proc `=destroy`[A, B](o: var TMyGeneric2[A, B]) =