Example
compile with --gc:arc
type Foo = ref object of RootObj
proc delete(self: Foo)
proc newFoo: Foo = new(result, delete)
proc delete(self: Foo) = echo("delete Foo")
if isMainModule:
proc test() = discard newFoo()
test()
Current Output
Expected Output
Additional Information
Tested nim version 1.4.2 up to devel (15e3813)
It works with --gc:refc, it gives a different problem if type Foo = ref object (see #19401)