> I am on Windows 10, Nim Compiler Version 0.18.0 [Windows: i386], MinGW GCC.
I don't know if that is just for windows 10, I am on ubuntu with 0.18.0 and I
am getting the same thing though my code is a little different
{.experimental.}
type thing = object
x:int
p:pointer
proc `=destroy`(o:thing):void =
if o.p != nil: dealloc o.p
echo "destroyed"
proc op():thing =
result = thing(x:10,p:alloc(1))
proc work(o:thing):void=
echo o
proc main() =
let t= op()
work(t)
main()
Hint: used config file '/etc/nim.cfg' [Conf]
Hint: system [Processing]
Hint: destruct [Processing]
CC: destruct
Hint: [Link]
Hint: operation successful (11723 lines compiled; 0.185 sec total; 22.32MiB
peakmem; Debug Build) [SuccessX]
Hint: /home/User/Desktop/nim/tests/destruct [Exec]
(x: 10, p: ...)