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

Reject pattern match with unexpected double splat inside array #3382

Merged
merged 1 commit into from
Jan 8, 2025

Conversation

ydah
Copy link
Member

@ydah ydah commented Jan 8, 2025

a => [-2**b] should be SyntaxError

Fixes: #3381

@eileencodes eileencodes merged commit 2e6baf9 into ruby:main Jan 8, 2025
58 checks passed
@ydah ydah deleted the 3381 branch January 8, 2025 17:27
@Earlopain
Copy link
Contributor

This seems to have some unintended consequence: https://github.com/ruby/ruby/actions/runs/12675763001/job/35327482624

[-2**32,2**32]
=> [4294967296, 4294967296] # Both are positive

@kddnewton
Copy link
Collaborator

I've opened a PR to revert this. Unfortunately doing this in the general expression parser does not take into account that this is a pattern match and should be rejected. We can't solve this in that place.

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.

a => [-2**b] should be SyntaxError but parse succeeds
4 participants