[ruby-core:113010] [Ruby master Bug#18748] Range#cover? returns true for beginless range of different type
From:
"nagachika (Tomoyuki Chikanaga) via ruby-core" <ruby-core@...>
Date:
2023-03-25 02:27:38 UTC
List:
ruby-core #113010
Issue #18748 has been updated by nagachika (Tomoyuki Chikanaga).
Backport changed from 2.7: REQUIRED, 3.0: REQUIRED, 3.1: REQUIRED to 2.7: REQUIRED, 3.0: REQUIRED, 3.1: DONE
ruby_3_1 477ab3f6c7f14c79e13f694463aa06a59206dda1 merged revision(s) c5475f42694eff35465c3332e0182c0611ca5918.
----------------------------------------
Bug #18748: Range#cover? returns true for beginless range of different type
https://bugs.ruby-lang.org/issues/18748#change-102544
* Author: jeremyevans0 (Jeremy Evans)
* Status: Closed
* Priority: Normal
* Backport: 2.7: REQUIRED, 3.0: REQUIRED, 3.1: DONE
----------------------------------------
While adding documentation to address #18155, I found a bug:
```ruby
(2..).cover?("2"..) # => false
(..2).cover?(.."2") # => true
```
I've submitted a pull request for fix this: https://github.com/ruby/ruby/pull/5831
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/