Issue #20324 has been reported by kyanagi (Kouhei Yanagita).
----------------------------------------
Bug #20324: `(1..).overlap?('foo'..)` returns true
https://bugs.ruby-lang.org/issues/20324
* Author: kyanagi (Kouhei Yanagita)
* Status: Open
* ruby -v: ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [arm64-darwin22]
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN
----------------------------------------
While thinking about finding the intersection of two ranges, I found that
`(1..).overlap?('foo'..)` returns true.
In the current implementation, it seems that `(a..).overlap?(b..)` or
`(..a).overlap?(..b)` returns true regardless of what `a` or `b` are.
However, I think it should return true if and only if `a` and `b` are comparable.
(What is the intersection of `1..` and `'foo'..`?)
--
https://bugs.ruby-lang.org/