Unflag a splatted flagged hash if the method doesn't use ruby2_keywords + use latest rspec-mocks#5684
Merged
eregon merged 3 commits intoApr 5, 2022
Conversation
28335c4 to
3c75d30
Compare
29bf545 to
5f8cd69
Compare
5f8cd69 to
9cd764d
Compare
Member
Author
|
@jeremyevans There is a rspec-mocks release with the fix now (3.11.1), so I updated to that and hopefully the Bundler tests should pass now. |
For a method such as: def foo(*callee_args) end If this method is called with a flagged hash (created by a method flagged with ruby2_keywords), this previously passed the hash through without modification. With this change, it acts as if the last hash was passed as keywords, so a call to: foo(*caller_args) where the last element of caller_args is a flagged hash, will be treated as: foo(*caller_args[0...-1], **caller_args[-1]) As a result, inside foo, callee_args[-1] is an unflagged duplicate of caller_args[-1] (all other elements of callee_args match caller_args). Fixes [Bug #18625]
38d21fc to
3d0aac9
Compare
4 tasks
ivoanjo
added a commit
to DataDog/dd-trace-rb
that referenced
this pull request
Apr 12, 2022
A maximum version was initially added in #1495 because we expected the `ruby2_keywords` method to be removed (see the PR for the discussion). Now Ruby 3.2.0-preview1 is out and `ruby2_keywords` are still there, and there's even a recent change for it in ruby/ruby#5684 that is documented as "ruby2_keywords needed in 3.2+". So for now let's bump the maximum version to < 3.3 to allow the Ruby 3.2 series to be supported and we can keep an eye on the Ruby 3.2 test releases to see if anything changes. (Otherwise, once Ruby 3.2.0 stable is out, we should probably bump this to 3.4, and so on...)
ivoanjo
added a commit
to DataDog/dd-trace-rb
that referenced
this pull request
May 4, 2022
A maximum version was initially added in #1495 because we expected the `ruby2_keywords` method to be removed (see the PR for the discussion). Now Ruby 3.2.0-preview1 is out and `ruby2_keywords` are still there, and there's even a recent change for it in ruby/ruby#5684 that is documented as "ruby2_keywords needed in 3.2+". So for now let's bump the maximum version to < 3.3 to allow the Ruby 3.2 series to be supported and we can keep an eye on the Ruby 3.2 test releases to see if anything changes. (Otherwise, once Ruby 3.2.0 stable is out, we should probably bump this to 3.4, and so on...)
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.
#5645 (https://bugs.ruby-lang.org/issues/18625) + rspec/rspec-mocks#1464