Open
Conversation
Expand `...` (ForwardingParameterNode) into `*args, **kwargs, &block` instead of crashing with an unexpected parameter error. Based on #562
Member
|
I think the changes are fine, but I do want to confirm one aspect of this. There one minor difference before def foo(...)
# there's no way to use forwarding parameters that isn't including all
# of them. I can't print only the keyword ones or refer exclusively to the block
end
def bar(*args, **kwargs, &block)
# Here, while equivalent at the call site (accepts any argument), I can refer
# to the individual parameter parts
endIs this something we need to be concerned about? Would it be better to have RBI print the forwarding parameter instead? |
amomchilov
approved these changes
Apr 6, 2026
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.
Summary
Expand
...(ForwardingParameterNode) into*args, **kwargs, &blockinstead of crashing with an unexpected parameter error.Based on #562 by @kddnewton — simplified the approach to avoid wrapping every case in arrays: just
map→flat_mapand a single newwhenbranch.Includes test for both
def m1(...)anddef m2(a, ...).Closes #562