Skip to content

Conversation

@paracycle
Copy link
Member

Let's use the latest Ruby version for development

@paracycle paracycle requested a review from a team as a code owner January 5, 2026 20:13
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.
@paracycle paracycle added the enhancement New feature or request label Jan 5, 2026
@paracycle paracycle changed the title Bump gem to Ruby 4.0 Make gem compatible with Ruby 4.0 Jan 5, 2026
@paracycle
Copy link
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.

@paracycle paracycle merged commit 88d3fca into main Jan 5, 2026
17 of 20 checks passed
@paracycle paracycle deleted the uk-bump-to-4.0 branch January 5, 2026 22:57
@amomchilov
Copy link
Contributor

This also fixed the CI by pulling in sorbet/sorbet#9804

Thanks!

@paracycle
Copy link
Member Author

This also fixed the CI by pulling in sorbet/sorbet#9804

Thanks!

@amomchilov I believe those were fixed by these lines: https://github.com/Shopify/tapioca/pull/2473/files#diff-b6efeaf7c856fb7aaf37167b260c87ab44d81079038f785fdac34fbf901da5f5R7-R9

@amomchilov
Copy link
Contributor

Ah true. I fixed it without surpression in #2483

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants