Repository navigation
Conversation
This branch has not been deployed
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 #1040
Summary
On Ruby 3+, calling a method with keyword arguments through
Concurrent::Async#asyncor#awaitfailed withArgumentError(e.g.wrong number of arguments (given 1, expected 0; required keyword: msg)) becauseAsyncDelegator#method_missingandAwaitDelegator#method_missingcaptured*argswithoutruby2_keywords.Changes
Concurrent::Async::AsyncDelegator#method_missingandConcurrent::Async::AwaitDelegator#method_missingwithruby2_keywords :method_missing if respond_to?(:ruby2_keywords, true), matching the existing pattern onClassMethods#new.spec/concurrent/async_spec.rbcovering required keyword arguments, optional and splat keyword arguments, keyword arguments with blocks, and positionalHasharguments for both#asyncand#await.Verification
ArgumentErrorbefore the change (38 examples, 2 failures, 1 pendingon Windows whereforkis unavailable).RUBYOPT="-w" bundle exec rspec spec/concurrent/async_spec.rbpasses after the change (38 examples, 0 failures, 1 pending) in both normal andISOLATED=trueruns, andspec/concurrent/ivar_spec.rbpasses alongside it (114 examples, 0 failures, 1 pending).