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
It's mostly an inconsistency that I accidentally caught when a test started failing.
It's a test for a piece of code that tries to figure out how many arguments it can pass to a listener (which can be a block, a lambda, a method, or anything callable). When the arity is -2 it can't really know how many are ok to pass so it just tries to call the method. In 9K the listener is called, but in previous versions of JRuby and in MRI there's an ArgumentError.
If I could choose I'd like all Rubies to work like 9K, but I thought I'd report it since it's an inconsistency with MRI.
I would like to see this solved before we entertain call protocol changes in IR for blocks which will not happen for 9k.0 but still we should fully nail all semantics of blocks down before trying to tackle it.
My concern with this is that lambdas have always raised arity errors, and if they aren't now we've got a significant behavioral difference. It's a difference most people won't see, but I don't like it anyway.