Actions
Bug #21174
closedRange#max called with an argument on a beginless Integer Range raises RangeError
Bug #21174:
Range#max called with an argument on a beginless Integer Range raises RangeError
Description
It seems surprising but instead of returning last n Integers Range#max(n) raises RangeError:
(nil..10).max(2)
# => (irb):3:in 'Range#max': cannot get the maximum of beginless range with custom comparison method (RangeError)
I would expect [9, 10] to be returned.
Actions