Actions
Feature #8184
openAvoid the creation of meaningless ranges (nil, false, true)
Status:
Open
Assignee:
-
Target version:
-
Description
With the definition of <=> on Object on post 1.8, the range_init() function no more throws "ArgumentError: bad value for range" when creating these ranges:
nil..nil
false..false
true..true
These kind of ranges are meaningless, the majority of methods on Range do not work on them, like (nil..nil).include?(nil).
This feature request (with patch) re-introduces the 1.8 behaviour of throwing ArgumentError when creating such ranges.
Files
No data to display
Actions
Like0