Skip to content

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
Collaborator

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