Repository navigation
Kernel: advance MRI 4.0.6 conformance (core/kernel residuals) - #553
Merged
Merged
Conversation
…merics, singleton freeze
Kernel#Array now follows MRI's rb_Array: #to_ary then #to_a (each may decline
with nil), a non-Array result is a TypeError, and only an unconvertible value is
wrapped as [v]. Kernel#Hash is newly defined (nil/empty-Array to {}, #to_hash
otherwise, TypeError on failure) and registered as a module_function. Kernel#String
returns a String/String-subclass untouched (no #to_s), honours an overridden
#respond_to?(:to_s) that hides an existing #to_s, and turns a NoMethodError from a
missing #to_s into a TypeError while still allowing a #method_missing answer.
isFrozen now reports Bignum, Complex and Rational as frozen (immutable value
objects), and Object#freeze also freezes an already-materialised singleton class.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…gleton copy dup now runs #initialize_dup (which delegates to #initialize_copy) on the shallow copy; clone runs #initialize_clone, copies the frozen state (a freeze: true/false/nil keyword overrides it and is forwarded to #initialize_clone, an invalid value or unknown keyword raising ArgumentError), and clones the singleton class so per-object methods, singleton-included modules and singleton constants carry over — for both an *RObject inline singleton and the side-table singleton of an Array/Hash/String. Adds the default private Kernel copy hooks #initialize_copy (same-object no-op, FrozenError on a frozen receiver, TypeError across classes), #initialize_dup and #initialize_clone, and preserves instance-variable order across dupValue. Fixes core/kernel dup, clone, initialize_copy/dup/clone specs to full MRI parity (clone 18->30) and core/array clone singleton copy. 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.
Advances core/kernel residuals against MRI 4.0.6 (edit-in-place, no shadowed definitions). Suite + wasm + gofmt verified locally before push; FLOOR untouched — consolidated ratchet bump follows once the wave lands.
🤖 Generated with Claude Code