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

Comments

Projects
None yet
4 participants
@chrisseaton
Contributor

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

This comment has been minimized.

Show comment
Hide comment
@headius

headius May 31, 2016

Member

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.

Member

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

This comment has been minimized.

Show comment
Hide comment
@eregon

eregon Jun 15, 2016

Member

I think bccf82e from @enebo might address this :)

Member

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