Project

General

Profile

Actions

Bug #21185

closed

Range#overlap? is not commutative with doubly-unbounded range argument.

Added by jeromepl (Jerome Parent-Levesque) 20 days ago. Updated 18 days ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [arm64-darwin24]
[ruby-core:121372]

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.

Actions

Also available in: Atom PDF

Like0
Like0Like0