Skip to content

Adds a couple of specs #13141

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

Merged
merged 2 commits into from
Apr 23, 2025
Merged

Adds a couple of specs #13141

merged 2 commits into from
Apr 23, 2025

Conversation

fxn
Copy link
Contributor

@fxn fxn commented Apr 20, 2025

In a class definition like this:

class D < C
end

there might be a const_added hook, and also an inherited hook being triggered when D is just created.

Those are user-level hooks, and the following is observable:

  1. When they are invoked, the class object stored in D has been created and it has the expected superclass.
  2. When they are invoked, the constant has been created and constant-related state reflects that.

The specs proposed in this patch specify this contract.

(What I described above is the consensus achieved in discussions in https://bugs.ruby-lang.org/issues/21143, https://bugs.ruby-lang.org/issues/21193, and related PRs.)

/cc @byroot @eregon

Copy link

launchable-app bot commented Apr 20, 2025

All Tests passed!

✖️no tests failed ✔️61961 tests passed(2 flakes)

Copy link
Member

@byroot byroot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Will wait in case @eregon has any objections.

@byroot byroot merged commit 5f3fb35 into ruby:master Apr 23, 2025
88 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants