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

parser: fix infix expr handling with cast on left side of << operator #19985

Merged
merged 3 commits into from
Nov 24, 2023

Conversation

felipensp
Copy link
Member

@felipensp felipensp commented Nov 24, 2023

Fix #19978

🤖[deprecated] Generated by Copilot at d602b26

This pull request fixes a parser bug with cast and left shift operators and adds a test file to check the correct precedence. The bug affected expressions like u8(1) << 1 + 1 and caused incorrect parsing and compilation errors.

🤖[deprecated] Generated by Copilot at d602b26

  • Fix parser bug for cast expressions followed by left shift and infix operators (link)
  • Add test file vlib/v/tests/cast_precedence_test.v for cast precedence scenarios (link)

@felipensp felipensp changed the title parser: fix infix expr handling with cast on left side parser: fix infix expr handling with cast on left side of << operator Nov 24, 2023
@felipensp felipensp marked this pull request as ready for review November 24, 2023 14:43
@spytheman spytheman merged commit 90d3523 into vlang:master Nov 24, 2023
53 of 54 checks passed
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.

Operator precedence is wrong when casted value is left-shifted in if/match expr
2 participants