Issue #22470 has been reported by swebb (Steven Webb). ---------------------------------------- Bug #22470: Array#find and Array#rfind arity change between versions 3 and 4 https://bugs.ruby-lang.org/issues/22470 * Author: swebb (Steven Webb) * Status: Open * ruby -v: 4.0.9 * Backport: 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN ---------------------------------------- Ruby 4 introduced native implementations of Array#find and Array#rfind (Feature #21678). However, the new implementations changed how it behaves with multiple arguments: ruby 3.4.8: ``` ruby -e "[].find(1, 2)" -e:1:in 'Enumerable#find': wrong number of arguments (given 2, expected 0..1) (ArgumentError) from -e:1:in '<main>' ``` ruby 4: ``` ruby -e "[].find(1, 2)" # returns an instance of Enumerable and doesn't generate any output ``` This feels like a bug to me as it means Array#find no longer has the same behaviour as Enumerable#find. -- https://bugs.ruby-lang.org/