You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c81ffc8
Browse filesBrowse the repository at this point in the historyBrowse files
vm: home enum_for/to_enum on Kernel, and hold the VCALL verdict to plain names
Three things, each measured against ruby 4.0.5 before and after.
enum_for / to_enum (G3). registerEnumerator runs from NewVM AFTER
rehomeKernelMethods (#735) -- it needs the prelude's Enumerable -- so its two
vm.cObject.define calls re-introduced on Object the last two names MRI puts on
Kernel. Object.instance_method(:enum_for).owner now answers Kernel as it does on
4.0.5, Kernel.public_instance_methods(false) carries the pair, and
Object.public_instance_methods(false) drops from 78 to 76. The exact-set
assertion in wave_d_kernel_homing_test.go that named this pair as known residue
is now an assertion of the EMPTY set, so the shape that produced it -- a Kernel
method built after the re-homing pass -- still fails there. The definition lives
in MRI's enumerator.c, which this C corpus does not carry, so the oracle for the
placement is the running 4.0.5, stated as such.
vcallNameShape. `nope!` and `nope?` are written with no receiver, no
parentheses, no arguments and no block, so the compiler's SHAPE test sets
FlagSendVCall for them -- but they lex as tFID and `primary : tFID` builds
NEW_FCALL (parse.y-ruby_4_0:4370), while gettable reaches NEW_VCALL only under
case ID_LOCAL (parse.y-ruby_4_0:13086). Both raise NoMethodError on 4.0.5 under
`--parser=parse.y` AND `--parser=prism`. The name test belongs beside the shape
test in internal/compiler, which is outside this cluster; it is at the raise
site meanwhile, where it costs nothing because an error is already being raised.
Three tests encoded the old answer for a bare name and now encode MRI's.
string_plus / string_concat_encoding asserted that an error raised inside
#to_str propagates rather than being swallowed as a TypeError: their probes take
an explicit receiver so they keep asserting NoMethodError, with the bare form
added beside one of them as NameError. TestIRBErrorDisplay now expects
(NameError), which is what `irb` itself prints for a bare undefined name.
Two comments in kernel_introspect.go named registerKernelModuleFunctions, which
no longer exists; the split is rehomeKernelMethods over kernelModuleFunctionNames.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
0 commit comments