Skip to content

Check if respond_to_missing? exists before respond_to?#9280

Merged
headius merged 1 commit intojruby:jruby-10.0from
headius:respond_to_missing_missing
Mar 3, 2026
Merged

Check if respond_to_missing? exists before respond_to?#9280
headius merged 1 commit intojruby:jruby-10.0from
headius:respond_to_missing_missing

Conversation

@headius
Copy link
Member

@headius headius commented Mar 3, 2026

Old logic did a hard dispatch to respond_to_missing? if respond_to? returned false. This breaks any case where respond_to_missing? has been removed from a class altogether.

The change here tries to mimic the CRuby logic, first checking if respond_to? exists and returns true, and if it does not, only call respond_to_missing? if it exists.

Fixes #9258

Old logic did a hard dispatch to respond_to_missing? if respond_to?
returned false. This breaks any case where respond_to_missing? has
been removed from a class altogether.

The change here tries to mimic the CRuby logic, first checking if
respond_to? exists and returns true, and if it does not, only call
respond_to_missing? if it exists.

Fixes jruby#9258
@headius headius added this to the JRuby 10.0.4.0 milestone Mar 3, 2026
@headius headius changed the base branch from master to jruby-10.0 March 3, 2026 06:03
@headius headius merged commit fde405b into jruby:jruby-10.0 Mar 3, 2026
79 checks passed
@headius headius deleted the respond_to_missing_missing branch March 3, 2026 18:38
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.

Kernel#respond_to? fails if #respond_to_missing? is not defined

1 participant