Skip to content

Make the prelude's internal helpers private - #440

Merged
tannevaled merged 1 commit into
mainfrom
feat/cluster12
Aug 24, 2026
Merged

tannevaled merged 1 commit into
mainfrom
feat/cluster12

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Comparable#__compare and Enumerable's __each_packed / __pack /
__enum_int_arg are rbgo implementation helpers, but they were defined
as public methods, so they leaked into
Comparable.instance_methods and Enumerable.instance_methods where
MRI exposes no such names — and any class including these modules
answered respond_to?(:__compare) with true.

They are now marked private, so they disappear from the public method
lists and respond_to? (matching MRI) while still working through the
operators and iterators that call them with an implicit receiver (and
through #send).

This is a reflection-fidelity fix: no conformance-spec count changes
(the leak was not directly asserted by a spec), but
Comparable.instance_methods(false) now returns exactly
[:<, :<=, :==, :>, :>=, :between?, :clamp] as MRI does. Verified
against ruby 4.0.6; the whole-suite coverage gate stays at 100.0% and a
full language+core sweep shows no regressions.

🤖 Generated with Claude Code

Comparable#__compare and Enumerable's __each_packed / __pack /
__enum_int_arg are rbgo implementation helpers, but they were defined as
public methods, so they leaked into Comparable.instance_methods and
Enumerable.instance_methods where MRI exposes no such names. That made
the reflection API diverge (and any class including these modules
answered respond_to?(:__compare) with true).

They are now marked private, so they disappear from the public method
lists and respond_to? (matching MRI) while still working through the
operators and iterators that call them with an implicit receiver (and
through #send). No conformance-spec count changes — the leak was not
directly asserted — but the reflection API now matches MRI exactly.

Verified against ruby 4.0.6; whole-suite coverage gate stays at 100.0%
and a full language+core sweep shows no regressions.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit 5fe2c04 into main Aug 24, 2026
7 checks passed
@tannevaled
tannevaled deleted the feat/cluster12 branch August 24, 2026 10:32
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