Skip to content

Add specs for defined? on protected methods#1362

Merged
eregon merged 1 commit into
ruby:masterfrom
sampokuokkanen:defined-protected-method-coverage
May 27, 2026
Merged

Add specs for defined? on protected methods#1362
eregon merged 1 commit into
ruby:masterfrom
sampokuokkanen:defined-protected-method-coverage

Conversation

@sampokuokkanen
Copy link
Copy Markdown
Contributor

Covers protected methods accessed via subclass receiver, base-class receiver, and a shared included module. The module case is guarded by ruby_bug "#22076" until 4.1. MRI's defined? returned nil when the call would have succeeded. Fix is in master with backports marked as required for 3.3, 3.4, 4.0.

MRI fix: ruby/ruby#17069
Bug #22076

Hopefully I used ruby_bug correctly.

Covers protected methods accessed via subclass receiver, base-class receiver, and a shared included module. The module case is guarded by ruby_bug "#22076" until 4.1. MRI's defined? returned nil when the call would have succeeded; fix is in master with backports REQUIRED for 3.3, 3.4, 4.0.
@sampokuokkanen sampokuokkanen force-pushed the defined-protected-method-coverage branch from 075e387 to e21a444 Compare May 27, 2026 13:24
Copy link
Copy Markdown
Member

@eregon eregon left a comment

Choose a reason for hiding this comment

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

Looks good, thank you and sorry for slow review

@eregon eregon merged commit ea2a398 into ruby:master May 27, 2026
28 checks passed
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.

2 participants