"[2].to_enum.find_index(2.0)" returns 0 (to match MRI behavior)#3325
Merged
Conversation
alexdowad
added a commit
to hamstergem/hamster
that referenced
this pull request
Sep 14, 2015
I have sent a potential fix to JRuby: jruby/jruby#3325 If the bug is fixed in JRuby, we can later remove this.
alexdowad
added a commit
to immutable-ruby/immutable-ruby
that referenced
this pull request
Sep 14, 2015
I have sent a potential fix to JRuby: jruby/jruby#3325 If the bug is fixed in JRuby, we can later remove this.
Member
|
very najs, I think @eregon would prefer having the spec/ruby/core/enumerable/find_index_spec.rb updated in a separate commit? |
Contributor
|
Yes, that would be nicer to merge back upstream (essentially the commit name would reflect just the spec not the "fix" part) |
…equality This matches the behavior of MRI.
The 'equals' method is used as an equivalent of `self#==`. `Fixnum#==` converts Float arguments, so `RubyFixnum.equals` should do so too. `RubyFixnum.op_equalOther` also converts `Bignum`s which are passed in, so maybe `RubyFixnum.equals` should do so too. But then again, when can a `Bignum` ever be equal to a `Fixnum`? In MRI, I'm pretty sure that is impossible, but maybe JRuby doesn't always "fixize" `Bignum`s? That is a question for someone else to answer. For now, this fixes a bug.
Contributor
Author
|
You got it. Have a look now. |
kares
added a commit
that referenced
this pull request
Sep 16, 2015
"[2].to_enum.find_index(2.0)" returns 0 (to match MRI behavior)
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.
This is a bug which I found while testing one of my gems on JRuby. Please have a look!