Example
compile with --gc:arc
type Foo = ref object
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
Error: internal error: expr: proc not init delete
Expected Output
Additional Information
Tested nim version 1.4.2 up to devel (15e3813)
If using type Foo = ref object of RootObj the problem is different: code compiles but silently skips finalizer call. I'm opening an independent issue for that.