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

[jRuby 9.1.0.0] Strange behavior with Enumerable::max method #3856

Closed
zocoi opened this Issue May 6, 2016 · 3 comments

Comments

Projects
None yet
2 participants
@zocoi

zocoi commented May 6, 2016

Environment

jRuby 9.1.0.0

Expected Behavior

in 9.0.1.0

jruby-9.0.1.0 :002 > [1,2,3,4,5].max {|el| puts el.inspect; el}
2
3
4
5
 => 5 

Actual Behavior

jruby-9.1.0.0 :002 > [1,2,3,4,5].max {|el| puts el.inspect; el }
[2, 1]
NoMethodError: undefined method `>' for [2, 1]:Array
    from org/jruby/RubyArray.java:4211:in `max'
    from (irb):2:in `<eval>'
    from org/jruby/RubyKernel.java:983:in `eval'
    from org/jruby/RubyKernel.java:1290:in `loop'
    from org/jruby/RubyKernel.java:1103:in `catch'
    from org/jruby/RubyKernel.java:1103:in `catch'

In MRI 2.3.1

2.3.1 :001 > [1,2,3,4,5].max {|el| puts el.inspect; el }
2
3
4
5
 => 5 

@zocoi zocoi changed the title from Strange behavior with Enumerable::max method to [jRuby 9.1.0.0] Strange behavior with Enumerable::max method May 6, 2016

@zocoi

This comment has been minimized.

Show comment
Hide comment
@zocoi

zocoi May 6, 2016

FYI, I end up using max_by instead

zocoi commented May 6, 2016

FYI, I end up using max_by instead

@headius

This comment has been minimized.

Show comment
Hide comment
@headius

headius May 9, 2016

Member

Grr. I ported over max and min from MRI but perhaps I messed something up. Will be fixed for 9.1.1.0

Member

headius commented May 9, 2016

Grr. I ported over max and min from MRI but perhaps I messed something up. Will be fixed for 9.1.1.0

@headius headius added this to the JRuby 9.1.1.0 milestone May 9, 2016

@headius headius closed this in 06f63da May 9, 2016

headius added a commit that referenced this issue May 9, 2016

@zocoi

This comment has been minimized.

Show comment
Hide comment

zocoi commented May 9, 2016

thanks @headius

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment