Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Case with complex when uses == instead of === #4804
jruby 22.214.171.124 and jruby 126.96.36.199
In irb, or in a file, put the following:
So in the second case, == is called instead of ===.
I'm working on something that generates code, and a more complex version of this happens. I managed to reduce the issue to this simple case. This work as expected in MRI.
Another different example of the issue:
The IR in both cases appears to be identical. So it's something inside the eqq instruction, most likely.
Note in my example eqeqeq is defined as a call rather than a local variable, but it shouldn't matter to IR.
Oops, I should have paid closer attention to your report. I just realized you reported against 188.8.131.52 and 184.108.40.206, and indeed both versions do use
However, it seems only JRuby master, which will become JRuby 9.2, has fixed this.
@enebo Maybe this can be backported, but I'm also not sure if we're doing another 9.1.x.
If it's fixed on master, then that's good. For my use case, I found a workaround using
Up to you if you still want to backport.
Edit: Just tested, i confirm things are working fine on jruby-head. Sorry, I didn't think to check against it.