-
Notifications
You must be signed in to change notification settings - Fork 914
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Different behavior for Array#reject in required file #8225
Comments
This can just be reduced to:
If run by default command-line we unconditionally compile the main file and if compiled this works as expected. If I run it with interpreter (jruby --dev reject1.rb) then we see the wrong binding. |
So this is specific to how we dispatch from some enumerable methods (and possibly others) but only when calling into the interpreter. This partially explains why we didn't see this failing. If I just call a proc with |
In the end one proc parameter method was not updated for the arity "fix" for |
Is there a test we can add for this somewhere? I know these JIT-Int-JIT transitions are hard to test. 🫤 |
@headius this is not a JIT-int-JIT thing but merely it did not work from native -> int for yieldSpecific. I added a regression test which will run as interp. Should be covered. |
A few days ago I noticed a behavior change related to Array#reject using GitHub Actions and jruby-head.
Today I was able to obtain the following minimal reproducible example using Linux and RVM with two files:
test_jruby.rb
test_jruby2.rb
The expected output contains the description strings and the first element,
e
, of each Array.Output of Ruby MRI 3.3.1 (expected)
Output of JRuby 9.4.7.0 (expected)
Output of JRuby head (unexpected output in test2)
Note that using underscore,
[[1,2]].reject {|e,_| p e}
, is enough to obtain the correct behavior.This used to work without the underscore and the difference between main and required files is surprising.
The text was updated successfully, but these errors were encountered: