Actions
Bug #11975
closedRange#last is not consistent and possibly does not do what is expected.
Bug #11975:
Range#last is not consistent and possibly does not do what is expected.
Description
The following example demonstrates an inconsistency with Range:
This is expected behaviour:
(0..10).last => 10
(0..10).to_a.last => 10
This is unexpected behaviour:
(0...10).last => 10 # (should be 9?)
(0...10).to_a.last => 9
I believe that Range#last should give the last valid value for a range. Discussion?
Actions