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

feat(compiler): addition and subtraction assignment operators implementation #4018

Merged

Conversation

wzslr321
Copy link
Contributor

@wzslr321 wzslr321 commented Aug 30, 2023

Fixes #4005

Implemented a += and -= operators, as a new type of StmtKind::Assignment.

  • Type Check allows only for numbers to be used on both sides of the operator.

Checklist

  • Title matches Winglang's style guide
  • Description explains motivation and solution
  • Tests added (always)
  • Docs updated (only required for features)
  • Added pr/e2e-full label if this feature requires end-to-end testing

By submitting this pull request, I confirm that my contribution is made under the terms of the Wing Cloud Contribution License.

@wzslr321 wzslr321 requested a review from a team as a code owner August 30, 2023 16:04
@wzslr321 wzslr321 changed the title feat(compiler): Addition and subtraction assignment operators implementation feat(compiler): addition and subtraction assignment operators implementation Aug 30, 2023
libs/tree-sitter-wing/grammar.js Outdated Show resolved Hide resolved
libs/wingc/src/ast.rs Outdated Show resolved Hide resolved
@monadabot monadabot added the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Sep 2, 2023
Copy link
Contributor

@yoav-steinberg yoav-steinberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done, added a few comments

docs/docs/03-language-reference.md Outdated Show resolved Hide resolved
libs/wingc/src/type_check.rs Show resolved Hide resolved
libs/wingc/src/type_check.rs Outdated Show resolved Hide resolved
libs/wingc/src/type_check/class_fields_init.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@yoav-steinberg yoav-steinberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

Copy link
Contributor

@staycoolcall911 staycoolcall911 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Great work @wzslr321!

@staycoolcall911 staycoolcall911 removed the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Sep 5, 2023
@MarkMcCulloh MarkMcCulloh dismissed their stale review September 5, 2023 14:34

feedback addressed

@monadabot monadabot added the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Sep 5, 2023
@MarkMcCulloh MarkMcCulloh removed the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Sep 5, 2023
@mergify
Copy link
Contributor

mergify bot commented Sep 5, 2023

Thanks for contributing, @wzslr321! This PR will now be added to the merge queue, or immediately merged if feature/compiler/add-and-sub-assignment-ops is up-to-date with main and the queue is empty.

mergify bot added a commit that referenced this pull request Sep 5, 2023
@mergify mergify bot merged commit f1446e7 into winglang:main Sep 5, 2023
12 checks passed
@monadabot
Copy link
Contributor

Congrats! 🚀 This was released in Wing 0.29.3.

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.

Operators: addition and subtraction assignment operators (+= and -= respectively)
6 participants