Skip to content

Destructors are not inherited #13810

Closed
@sealmove

Description

@sealmove

devel branch, --gc:arc

=destroy is not invoked when it's inherited.

import streams

type
  A = ref AObj
  AObj = object of RootObj
    io: Stream
  B = ref object of A
    x: int

proc `=destroy`(x: var AObj) =
  close(x.io)
  echo "closed"
  
var x = B(io: newStringStream("thestream"))

No output.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions