diff options
author | Jeremy Evans <code@jeremyevans.net> | 2022-04-21 19:46:17 -0700 |
---|---|---|
committer | Jeremy Evans <code@jeremyevans.net> | 2022-06-06 09:59:22 -0700 |
commit | c5475f42694eff35465c3332e0182c0611ca5918 (patch) | |
tree | 580a6b99eac40d94b8b6c528f70d11aff9e9dbff /yjit | |
parent | 7cda7fbbdc14f4262afaa94cdeb5a5987f1eb01a (diff) | |
download | ruby-c5475f42694eff35465c3332e0182c0611ca5918.tar.gz |
Fix Range#cover? returning true for beginless ranges of different types
Previously `(2..).cover?("2"..)` was false, but
`(..2).cover?(.."2")` was true. This changes it so both are false,
treating beginless ranges the same as endless ranges in regards to
type checks.
This also adds documentation to #cover? to describe behavior with
beginless and endless ranges, testing each documentation example,
which is how this bug was found.
Fixes [Bug #18155]
Diffstat (limited to 'yjit')
0 files changed, 0 insertions, 0 deletions