Skip to content

Conversation

@skryukov
Copy link
Contributor

This PR fixes false negatives for default values wrapped into lambdas and procs.

Source of the problem:

la = ->(a,b,*c) {}
pr = proc {|a,b,*c|}


lambda.arity #=> -3
proc.arity #=> -3

lambda.method(:call).arity #=> -1
proc.method(:call).arity #=> -1

I left it possible to use defaults with one (and only one) splat operator.

@skryukov skryukov requested a review from solnic as a code owner October 11, 2021 07:56
@skryukov skryukov force-pushed the fix/deafult-arity-check branch from f12cf14 to 1e6e9f2 Compare October 11, 2021 08:36
@nepalez nepalez changed the base branch from main to fix/default-arity-checks July 25, 2022 18:11
@nepalez nepalez requested review from nepalez and removed request for nepalez July 25, 2022 18:18
@nepalez
Copy link
Contributor

nepalez commented Jul 25, 2022

Hey @solnic
It looks like your review is necessary even to merge Svyatoslav's PR into my branch (I'd like to recheck and fix rubocop issues before opening a PR to main branch)
Could you look at it, please?

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.

2 participants