inconsistent each and each_with_index return #4046

Closed
kares opened this Issue Aug 1, 2016 · 1 comment

Comments

Projects
None yet
1 participant
@kares
Member

kares commented Aug 1, 2016

in Ruby these return self - so they should do the same for Java integration (instead of nil) :

jruby-9.1.2.0 :001 > require 'set'
 => true 
jruby-9.1.2.0 :002 > ret = Set.new([1, 2]).each { |i| i }
 => #<Set: {1, 2}> 
jruby-9.1.2.0 :003 > ret = java.util.ArrayList.new([1]).each { |i| i }
 => nil 
jruby-9.1.2.0 :004 > ret = java.util.HashSet.new([1]).each { |i| i }
 => nil 
jruby-9.1.2.0 :005 > ret = [].each { |i| i }
 => [] 

@kares kares added this to the JRuby 9.1.3.0 milestone Aug 1, 2016

@kares kares self-assigned this Aug 1, 2016

@kares

This comment has been minimized.

Show comment
Hide comment
@kares

kares Aug 1, 2016

Member

fixed with 9020527

Member

kares commented Aug 1, 2016

fixed with 9020527

@kares kares closed this Aug 1, 2016

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