[ruby-core:121372] [Ruby Bug#21185] Range#overlap? is not commutative with doubly-unbounded range argument.

Issue #21185 has been reported by jeromepl (Jerome Parent-Levesque). ---------------------------------------- Bug #21185: Range#overlap? is not commutative with doubly-unbounded range argument. https://bugs.ruby-lang.org/issues/21185 * Author: jeromepl (Jerome Parent-Levesque) * Status: Open * ruby -v: ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [arm64-darwin24] * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- In https://bugs.ruby-lang.org/issues/20725 the following: ``` ruby (nil..nil).overlap?(..3) ``` was fixed to output `true` instead of `false`. However, when reversing the order of the arguments the output is wrong: ``` ruby (..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. -- https://bugs.ruby-lang.org/

Issue #21185 has been updated by jeromepl (Jerome Parent-Levesque). https://github.com/ruby/ruby/pull/12937 ---------------------------------------- Bug #21185: Range#overlap? is not commutative with doubly-unbounded range argument. https://bugs.ruby-lang.org/issues/21185#change-112343 * Author: jeromepl (Jerome Parent-Levesque) * Status: Open * ruby -v: ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [arm64-darwin24] * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- In https://bugs.ruby-lang.org/issues/20725 the following: ``` ruby (nil..nil).overlap?(..3) ``` was fixed to output `true` instead of `false`. However, when reversing the order of the arguments the output is wrong: ``` ruby (..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. -- https://bugs.ruby-lang.org/
participants (1)
-
jeromepl (Jerome Parent-Levesque)