Project

General

Profile

Actions

Feature #8184

open

Avoid the creation of meaningless ranges (nil, false, true)

Added by phi (Pascal Hurni) over 11 years ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:53822]

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

range_init_patch.diff (807 Bytes) range_init_patch.diff phi (Pascal Hurni), 03/29/2013 11:16 PM

No data to display

Actions

Also available in: Atom PDF

Like0