Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable refc with move analyzer #23782

Draft
wants to merge 4 commits into
base: devel
Choose a base branch
from
Draft

enable refc with move analyzer #23782

wants to merge 4 commits into from

Conversation

ringabout
Copy link
Member

@ringabout ringabout commented Jul 1, 2024

ref #12340

@ringabout ringabout changed the title investigate refc with injectdestructors enable refc with move analyzer Jul 18, 2024
@arnetheduck
Copy link
Contributor

what's the status of this one? it's highly interesting as migration path from refc to orc, as it makes it easier to use the same code with both collectors.

@ringabout
Copy link
Member Author

The problem is that refc cannot handle copying of upcast of subtypes. arc circumvents this issue by disabling ObjectAssignmentDefect.

@arnetheduck
Copy link
Contributor

The problem is that refc cannot handle copying of upcast of subtypes

so what would be the steps from here? do you mean valid or invalid upcasts?

@ringabout
Copy link
Member Author

I mean valid upcast now became illegal with this PR

type
  A {.inheritable.} = object
  B = object of A
    f: int

proc `=destroy`(x: var B) = discard


proc `$$`[T](x: sink T): string =
  "{}"

let a: ref A = new(B)
doAssert $$a[] == "{}"

it gives ObjectAssignmentDefect with this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants