Skip to content

Fixes #6540. difference with block keyword arguments.#6574

Merged
enebo merged 3 commits intojruby:jruby-9.2from
enebo:fix_call_kwargs
Feb 24, 2021
Merged

Fixes #6540. difference with block keyword arguments.#6574
enebo merged 3 commits intojruby:jruby-9.2from
enebo:fix_call_kwargs

Conversation

@enebo
Copy link
Member

@enebo enebo commented Feb 23, 2021

Our call logic was only using first incoming args[0] is arity was 1
and there is no kwrest(**a). This should be arity of 1 and the lack of
presence of any kwargs at all.

Intuitively, we know if we have kwargs at the callsite and the block
accepts kwargs...we should pass them forward.

We also know that procs will pass any extra args to the proc whether
the proc is defined to accept them or not. As opposed to lambdas which
would error because you are passing the wrong number.

So I feel pretty good about this fix but I am very leery on landing this
the day before a release. Blocks are tricky internally in Ruby.

Our call logic was only using first incoming args[0] is arity was 1
and there is no kwrest(**a).  This should be arity of 1 and the lack of
 presence of any kwargs at all.

Intuitively, we know if we have kwargs at the callsite and the block
accepts kwargs...we should pass them forward.

We also know that procs will pass any extra args to the proc whether
the proc is defined to accept them or not.  As opposed to lambdas which
would error because you are passing the wrong number.

So I feel pretty good about this fix but I am very leery on landing this
the day before a release.  Blocks are tricky internally in Ruby.
@enebo enebo requested a review from headius February 23, 2021 21:28
@enebo enebo added this to the JRuby 9.2.15.0 milestone Feb 23, 2021
@enebo enebo linked an issue Feb 23, 2021 that may be closed by this pull request
@enebo enebo merged commit ca5f28b into jruby:jruby-9.2 Feb 24, 2021
@enebo enebo deleted the fix_call_kwargs branch February 24, 2021 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cruby/Jruby behavior difference with block keyword arguments

2 participants