In general, I think that an enumerating operation against a beginless range should raise an exception. It is also the case at Range#last with an argument. Note that the meaning of Range#last with no argument is fairly different from the version with a length argument. See #8739 and #15523.
That said, Range#last might be handled as a special case. I have no strong opinion about this, but an exception is still one of the most reasonable design choices.
It is difficult to reversely enumerate the elements of Range from last. AFAIK, there is no precedent.
(-Float::INFINITY .. 1).last(2) also raises a TypeError.
(-Float::INFINITY .. 1).last(2) #=> can't iterate from Float (TypeError)
In general, I think that an enumerating operation against a beginless range should raise an exception. It is also the case at Range#last with an argument. Note that the meaning of Range#last with no argument is fairly different from the version with a length argument. See #8739 and #15523.
That said, Range#last might be handled as a special case. I have no strong opinion about this, but an exception is still one of the most reasonable design choices.
It is difficult to reversely enumerate the elements of Range from last. AFAIK, there is no precedent.
(-Float::INFINITY .. 1).last(2) also raises a TypeError.
(-Float::INFINITY .. 1).last(2) #=> can't iterate from Float (TypeError)
OK. I have no strong opinion, too.
I have realized this is a not "Bug". I change the tracker "Feature".