Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 5 commits into from May 1, 2024
Merged

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
74 checks passed
@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.

None yet

1 participant