Actions
Bug #22470
closedArray#find and Array#rfind arity change between versions 3 and 4
Bug #22470:
Array#find and Array#rfind arity change between versions 3 and 4
Description
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:
This feels like a bug to me as it means Array#find no longer has the same behaviour as Enumerable#find.
Updated by swebb (Steven Webb) 6 days ago
Updated by Earlopain (Earlopain _) 6 days ago
- Status changed from Open to Closed
- Backport changed from 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN to 3.3: DONTNEED, 3.4: DONTNEED, 4.0: REQUIRED
Actions