Skip to content

arity for {|a,| } was -2 and should have been 1#8129

Merged
enebo merged 5 commits intojruby:masterfrom
enebo:arity_fix
May 1, 2024
Merged

arity for {|a,| } was -2 and should have been 1#8129
enebo merged 5 commits intojruby:masterfrom
enebo:arity_fix

Conversation

@enebo
Copy link
Member

@enebo enebo commented Feb 27, 2024

arity for {|a,| } was -2 and should have been 1

We still use arity value for dispatch which led to four changes:

  1. anonrest which is after the a variable in first sentence means it is not really a rest so -2 (1+arity)*-1{rest} becomes 1
  2. generic yield must always check on positive arity whether it should be spreadable or not
  3. specific yields must also check spreadable
  4. ACP should not specify single value it is spreadable (since it will have more than one value).

We need to transition to something instead of arityValue in signature. I think an enum would likely simplify code and be more readable as well.

@enebo enebo added this to the JRuby 9.4.7.0 milestone Feb 27, 2024
@enebo enebo modified the milestones: JRuby 9.4.7.0, JRuby 9.4.8.0 Apr 29, 2024
@enebo enebo merged commit 26ad84c into jruby:master May 1, 2024
@enebo enebo deleted the arity_fix branch May 1, 2024 13:54
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.

1 participant