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

"each_with_object({}, &lambda_logic)" raise ArgumentError #2943

Closed
yousuketto opened this Issue May 15, 2015 · 0 comments

Comments

Projects
None yet
2 participants
@yousuketto
Copy link
Contributor

yousuketto commented May 15, 2015

ArgumentError did not occur in CRuby2.2.2 and JRuby1.7.19, but is occurred in JRuby9.0.0.0.pre2.

#example.rb
storategy = lambda{|str, hash| hash[str] = str}
p %w(a b c d e f g).each_with_object({}, &storategy)
$ jruby -v
jruby 9.0.0.0.pre2 (2.2.2) 2015-04-28 2755ae0 Java HotSpot(TM) 64-Bit Server VM 25.45-b02 on 1.8.0_45-b14 +jit [darwin-x86_64]
$ jruby example.rb 
ArgumentError: wrong number of arguments (1 for 2)
              each at org/jruby/RubyArray.java:1571
  each_with_object at org/jruby/RubyEnumerable.java:1014
             <top> at example.rb:2

@enebo enebo added this to the JRuby 9.0.0.0.rc1 milestone May 15, 2015

kares added a commit to kares/jruby that referenced this issue Jun 29, 2015

handle each_with_object (lambda) block arg like MRI
since `lambda{ |str, hash| }` was no longer working
(as in JRuby 1.7.x) fixes jruby#2943

@kares kares closed this in 53ff459 Jun 29, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.