Repository navigation
Make the prelude's internal helpers private - #440
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Comparable#__compareandEnumerable's__each_packed/__pack/__enum_int_argare rbgo implementation helpers, but they were definedas public methods, so they leaked into
Comparable.instance_methodsandEnumerable.instance_methodswhereMRI exposes no such names — and any class including these modules
answered
respond_to?(:__compare)withtrue.They are now marked
private, so they disappear from the public methodlists and
respond_to?(matching MRI) while still working through theoperators 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. Verifiedagainst 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