Actions
Bug #21185
closedRange#overlap? is not commutative with doubly-unbounded range argument.
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [arm64-darwin24]
Description
In https://bugs.ruby-lang.org/issues/20725 the following:
(nil..nil).overlap?(..3)
was fixed to output true
instead of false
.
However, when reversing the order of the arguments the output is wrong:
(..3).overlap?(nil..nil) # => Outputs `false` but should be `true`
I would like to attempt to fix this bug and will take a look at it this weekend.
Updated by jeromepl (Jerome Parent-Levesque) 19 days ago
Updated by Anonymous 17 days ago
- Status changed from Open to Closed
Applied in changeset git|b5cdbadeeddd2b8e834b9d5565c13fcc43f3e684.
[Bug #21185] Fix Range#overlap? with infinite range
Infinite ranges, i.e. unbounded ranges, should overlap with any other range
which wasn't the case in the following example: (0..3).overlap?(nil..nil)
Actions
Like0
Like0Like0