You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Probably related to #2320. I get similar results with lambda keyword arguments and keyword arguments passed as a Hash instead of passing them explicitly.
$ jruby -v
jruby 9.0.0.0.pre1 (2.2.0p0) 2015-01-18 746583b Java HotSpot(TM) 64-Bit Server VM 25.25-b02 on 1.8.0_25-b17 +jit [linux-amd64]
l=lambda{ |a:| a}l.call(a: 1)# wrong number of arguments (1 for 0)l.arity# 0 (1 in MRI 2.2.0p0)
After some debugging, I found out that in RubyBlock#prepareArgs the arity is checked on the Signature's arity object (a "Fixed0"), but keyword args would only be considered in Signature#checkArity.
Commit 2025534 solves the ArgumentError in your first snippet but does not fix your arity issue. Going to look at arity tests in MRI and see what we have tagged out.
Awesome, thank you! About the second example, it's weird. I was running this in irb, when I tried again it worked. But I found a script that reproduces it deterministically on my machine:
Probably related to #2320. I get similar results with lambda keyword arguments and keyword arguments passed as a Hash instead of passing them explicitly.
After some debugging, I found out that in
RubyBlock#prepareArgs
the arity is checked on theSignature
's arity object (a "Fixed0"), but keyword args would only be considered inSignature#checkArity
.Not sure if this is related or a different issue:
The text was updated successfully, but these errors were encountered: