Skip to content

Fix assertion failure with anonymous splats #13046

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

Merged
merged 1 commit into from
Apr 3, 2025

Conversation

jeremyevans
Copy link
Contributor

When calling a method that accepts an anonymous splat and literal keywords without any arguments, an assertion failure was previously raised. Set rest_index to 0 when setting rest to the frozen array, so the args_argc calculation is accurate.

While here, add more tests for methods with anonymous splats with and without keywords and keyword splats to confirm behavior is correct.

Also add a basic bootstrap test that would hit the previous assertion failure.

Fixes #13043

@jeremyevans jeremyevans requested a review from byroot April 2, 2025 17:30
Copy link
Member

@byroot byroot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@jeremyevans
Copy link
Contributor Author

Same Windows failures as in the master branch, so this seems safe to merge.

@jeremyevans jeremyevans enabled auto-merge (rebase) April 2, 2025 18:41
When calling a method that accepts an anonymous splat and literal
keywords without any arguments, an assertion failure was previously
raised. Set rest_index to 0 when setting rest to the frozen hash,
so the args_argc calculation is accurate.

While here, add more tests for methods with anonymous splats with
and without keywords and keyword splats to confirm behavior is
correct.

Also add a basic bootstrap test that would hit the previous assertion
failure.

Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
@jeremyevans jeremyevans force-pushed the fix-anon-splat-with-keywords branch from 757afa5 to 0f0900e Compare April 3, 2025 01:59
@jeremyevans jeremyevans merged commit 29dafa5 into ruby:master Apr 3, 2025
74 checks passed
@casperisfine
Copy link
Contributor

Just to confirm, the assertion failure is gone and builds are green again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants