Array#rassoc should try to convert to array implicitly. Fixes #20003#8904
Merged
mame merged 3 commits intoruby:masterfrom Nov 29, 2023
Merged
Array#rassoc should try to convert to array implicitly. Fixes #20003#8904mame merged 3 commits intoruby:masterfrom
mame merged 3 commits intoruby:masterfrom
Conversation
84c7835 to
b0e0d3b
Compare
b0e0d3b to
38e8902
Compare
auto-merge was automatically disabled
November 28, 2023 09:01
Head branch was pushed to by a user without write access
38e8902 to
b0e0d3b
Compare
Contributor
Author
|
@mame now everything passed, except the spec I introduced here ruby/spec#1110 I will update it after the merge |
Member
|
@bolshakov Could you update the mirrored spec file in this ruby/ruby repo directly? Changing ruby/spec is not reflected in real time. I want to keep the CI green. |
b0e0d3b to
71690c8
Compare
73c0455 to
44ad339
Compare
Contributor
Author
|
@mame I updated the specs, and all checks are green now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes https://bugs.ruby-lang.org/issues/20003
There is a difference between behaviour of
Array#assocandArray#rassoc. The first one performs implicit conversion (calls#to_ary) while the former does not.The
a.assoc(2)call returns[2, 3]as expected. However,a.rassoc(3)returnsnilExpected behaviour:
a.rassoc(3)returns[2, 3]in such cases.