Skip to content

Skip Class#initialize test on Ruby 4.1+ - #3236

Merged
ksss merged 1 commit into
ruby:masterfrom
ksss:fix-class-initialize-test-ruby-head
Oct 15, 2026
Merged

ksss merged 1 commit into
ruby:masterfrom
ksss:fix-class-initialize-test-ruby-head

Conversation

@ksss

@ksss ksss commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

ClassInstanceTest#test_initialize fails on ruby-head with TypeError: allocator undefined for Class.

ruby/ruby@0adee86 ("Prevent uninitialized classes from being allocated") made Class.allocate raise TypeError and removed Class#initialize entirely (class creation moved into Class.new). ruby/ruby skips this test in tool/rbs_skip_tests, and ruby/spec guards the corresponding specs with ruby_version_is ""..."4.1".

This PR runs the test only on Ruby < 4.1 via if_ruby(..."4.1"). core/class.rbs is unchanged since it still describes the current stable Ruby (4.0). Updating the signature for 4.1 (moving Class#initialize to Class.new) needs a DefinitionBuilder change as well, so it is left for a separate discussion.

🤖 Generated with Claude Code

Class#initialize was removed and Class.allocate now raises TypeError
in ruby/ruby@0adee86.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ksss ksss changed the title Skip Class#initialize test on Ruby 4.1+ Move Class#initialize signature to Class.new Oct 15, 2026
@ksss
ksss force-pushed the fix-class-initialize-test-ruby-head branch from 5bdae0c to 4d2062b Compare October 15, 2026 02:44
@ksss ksss changed the title Move Class#initialize signature to Class.new Skip Class#initialize test on Ruby 4.1+ Oct 15, 2026
@ksss
ksss added this pull request to the merge queue Oct 15, 2026
Merged via the queue into ruby:master with commit 7e434ad Oct 15, 2026
50 checks passed
@ksss
ksss deleted the fix-class-initialize-test-ruby-head branch October 15, 2026 03:46
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.

1 participant