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

fixes #23627; Simple destructor code gives invalid C #23631

Merged
merged 2 commits into from
May 21, 2024
Merged

Conversation

ringabout
Copy link
Member

@ringabout ringabout commented May 20, 2024

fixes #23627

type
  TestObj = object of RootObj

  TestTestObj = object of RootObj
    testo: TestObj

proc `=destroy`(x: TestTestObj) =
  echo "Destructor for TestTestObj"

proc testCaseT() =
  echo "\nTest Case T"
  let tt1 {.used.} = TestTestObj(testo: TestObj())

When generating const object fields, it's likely that
we need to generate type infos for the object, which may be an object with
custom hooks. We need to generate potential consts in the hooks first.

#20433 changed the semantics of initialization. It should evaluateBracedInit first.

@Araq Araq merged commit 309f97a into devel May 21, 2024
22 checks passed
@Araq Araq deleted the pr_rope_regression branch May 21, 2024 12:53
Copy link
Contributor

Thanks for your hard work on this PR!
The lines below are statistics of the Nim compiler built from 309f97a

Hint: mm: orc; opt: speed; options: -d:release
178571 lines; 8.137s; 753.043MiB peakmem

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.

Simple destructor code gives invalid C
2 participants