Skip to content

Finalizer not called for type ref object of RootObj when using ARC/ORC + Forward declaration #19402

@arkanoid87

Description

@arkanoid87

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

none

Expected Output

delete foo

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)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions