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

Array#min doesn't respect monkey patching #3944

Closed
chrisseaton opened this issue May 31, 2016 · 2 comments
Closed

Array#min doesn't respect monkey patching #3944

chrisseaton opened this issue May 31, 2016 · 2 comments
Labels
Milestone

Comments

@chrisseaton
Copy link
Contributor

@chrisseaton chrisseaton commented May 31, 2016

Environment

master

p [1, 2, 3].min

class Fixnum
  alias_method :old_cmp, :<=>
  def <=>(other)
    -old_cmp(other)
  end
end

p [1, 2, 3].min

Expected Behavior

1
3

Actual Behavior

1
1

I see this TODO

// TODO: check for overwritten <=> on Fixnum and String
, but it looks like it's been forgotten about and this broken behaviour has gone into the release.

@chrisseaton chrisseaton added the core label May 31, 2016
@headius
Copy link
Member

@headius headius commented May 31, 2016

I did not consider the TODO important enough to finish before 9.1, especially since we first need a better mechanism to check for overridden methods without doing a lookup. It was not forgotten...just unlikely to ever be reported by someone who isn't also working on a Ruby implementation.

@eregon
Copy link
Member

@eregon eregon commented Jun 15, 2016

I think bccf82e from @enebo might address this :)

@enebo enebo added this to the JRuby 9.1.3.0 milestone Jun 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.