Conversation
And fix broken shim RBI files
Morriar
approved these changes
Jan 5, 2026
Since Class.new is optimized in Ruby 4.0, it is no longer a method call anymore. Instead of getting `c_return` callbacks for `:new`, we get them for `:initialize` when we want to catch the return value for `Class.new` and `Module.new` calls. Moreover, the `return_value` of the tracepoint is correct for `Class.new` but is `nil` for `Module.new` for some reason. Instead dealing with that complexity, it is better to track constants using the relatively new `const_added` hook, as well as the existing TracePoint based mechanisms. Afterall, `const_added` was added partly because we motivated its usage in a tool like Tapioca, so we should have started using it since Ruby 3.3.
The `0.4.14` version doesn't build anymore for me, at least on my local computer, due to a native extension compile error. It seems like we can relax the version pinning and still get the same test behaviour.
Member
Author
|
I am not sure what the deal is with Ruby 4.0 and Rails 8.0, but it doesn't look related to the changes in this PR. I'll go ahead and merge anyway. |
Contributor
|
This also fixed the CI by pulling in sorbet/sorbet#9804 Thanks! |
Member
Author
@amomchilov I believe those were fixed by these lines: https://github.com/Shopify/tapioca/pull/2473/files#diff-b6efeaf7c856fb7aaf37167b260c87ab44d81079038f785fdac34fbf901da5f5R7-R9 |
Contributor
|
Ah true. I fixed it without surpression in #2483 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Let's use the latest Ruby version for development