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

a => [-2**b] should be SyntaxError but parse succeeds #3381

Open
tompng opened this issue Jan 8, 2025 · 1 comment · Fixed by #3382
Open

a => [-2**b] should be SyntaxError but parse succeeds #3381

tompng opened this issue Jan 8, 2025 · 1 comment · Fixed by #3382
Labels
bug Something isn't working

Comments

@tompng
Copy link
Member

tompng commented Jan 8, 2025

Parsing a in [-2**b] succeeds and executing it crash with this error

$ ruby -e "a in [-2**b]"
-e: [BUG] Unexpected node type in pattern matching expression: PM_CALL_NODE
ruby 3.5.0dev (2025-01-06T01:50:53Z master c8e3d745fa) +PRISM [x86_64-linux]

Found this code failed to RubyVM::InstructionSequence.compile while compiling every ruby code fragments in ruby repository

# spec/ruby/core/marshal/fixtures/marshal_data.rb:328
"Integer -2**8" => [-2**8,
                       "\004\bi\377\000"]
@Earlopain
Copy link
Contributor

Should be reopened, it was closed again by accident

@kddnewton kddnewton reopened this Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants