Skip to content
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

"[2].to_enum.find_index(2.0)" returns 0 (to match MRI behavior) #3325

Merged
merged 2 commits into from
Sep 16, 2015
Merged

"[2].to_enum.find_index(2.0)" returns 0 (to match MRI behavior) #3325

merged 2 commits into from
Sep 16, 2015

Conversation

alexdowad
Copy link
Contributor

This is a bug which I found while testing one of my gems on JRuby. Please have a look!

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.
@kares
Copy link
Member

kares commented Sep 15, 2015

very najs, I think @eregon would prefer having the spec/ruby/core/enumerable/find_index_spec.rb updated in a separate commit?

@eregon
Copy link
Member

eregon commented Sep 15, 2015

Yes, that would be nicer to merge back upstream (essentially the commit name would reflect just the spec not the "fix" part)

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.
@alexdowad
Copy link
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)
@kares kares merged commit df012fa into jruby:master Sep 16, 2015
@enebo enebo modified the milestone: Non-Release May 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants