Issue #8184 has been reported by phi (Pascal Hurni).

----------------------------------------
Feature #8184: Avoid the creation of meaningless ranges (nil, false, true)
https://bugs.ruby-lang.org/issues/8184

Author: phi (Pascal Hurni)
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: 


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.




-- 
http://bugs.ruby-lang.org/