Fix BinaryOp '=' overlap with VariableAssignment#268
Open
dhruvv16-hash wants to merge 6 commits intoarxlang:mainfrom
Open
Fix BinaryOp '=' overlap with VariableAssignment#268dhruvv16-hash wants to merge 6 commits intoarxlang:mainfrom
dhruvv16-hash wants to merge 6 commits intoarxlang:mainfrom
Conversation
58890b3 to
26d78c8
Compare
Contributor
|
hi @dhruvv16-hash , |
Author
|
Hi @m-akhil-reddy, |
Contributor
|
@dhruvv16-hash , as a good practice always ask if someone else is already working on an issue. it helps us to keep the community a a nice and friendly space for collaboration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Implemented the fix for
BinaryOphandling"="overlapping withVariableAssignment, so assignment is now handled only throughVariableAssignment.Removed assignment handling from
BinaryOpinsrc/irx/builders/llvmliteir.py.Added a safety guard so
BinaryOp("=")now raises:Assignment '=' should not be handled in BinaryOp. Use VariableAssignment instead.Kept assignment handling in
VariableAssignment, which remains the only valid assignment path.Added a regression test in
tests/test_binary_op.pyto verifyBinaryOp("=")is rejected.Added a regression test in
tests/test_variable_assignment.pyto verifyVariableAssignmentstill updates the variable correctly andprint(x)works.This is a codegen-only change and does not alter parser/frontend behavior.
Fixes: #265
Comments
Please verify that assignment is only handled through
VariableAssignment.Ensure other binary operators like
+,-,*,/, and comparisons still behave normally.The
BinaryOp("=")guard is intentional to prevent duplicated codegen paths and preserve the intended language design.Checklist:
Testing note:
Local automated test execution is still blocked on this machine by environment/dependency setup issues, not by a known code failure.
Before
After