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: &&=, ||=, >>=, <<= operators #853

Merged
merged 10 commits into from
Sep 25, 2024
Merged

Conversation

Gusarich
Copy link
Member

@Gusarich Gusarich commented Sep 19, 2024

Issue

Closes #811.

Checklist

  • I have updated CHANGELOG.md
  • I have documented my contribution in Tact Docs: https://github.com/tact-lang/tact-docs/pull/PR-NUMBER
  • I have added tests to demonstrate the contribution is correctly implemented: this usually includes both positive and negative tests, showing the happy path(s) and featuring intentionally broken cases
  • I have run all the tests locally and no test failure was reported
  • I have run the linter, formatter and spellchecker
  • I did not do unrelated and/or undiscussed refactorings

@Gusarich Gusarich requested a review from a team as a code owner September 19, 2024 19:47
@Gusarich Gusarich added this to the v1.6.0 milestone Sep 19, 2024
Copy link
Member

@anton-trunov anton-trunov left a comment

Choose a reason for hiding this comment

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

There is a bunch of result = result && ... expressions in semantics.tact -- would be nice to also dog-food here and refactor that code to use &&=.

Let's add a few negative tests, like n &&= true, where n is not a boolean, e.g. Int.

@anton-trunov anton-trunov self-assigned this Sep 23, 2024
Copy link
Member

@anton-trunov anton-trunov left a comment

Choose a reason for hiding this comment

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

Almost there, let's just fix some unintuitive error messages

src/types/__snapshots__/resolveStatements.spec.ts.snap Outdated Show resolved Hide resolved
src/types/__snapshots__/resolveStatements.spec.ts.snap Outdated Show resolved Hide resolved
src/types/__snapshots__/resolveStatements.spec.ts.snap Outdated Show resolved Hide resolved
src/types/resolveStatements.ts Outdated Show resolved Hide resolved
src/types/resolveStatements.ts Outdated Show resolved Hide resolved
src/types/resolveStatements.ts Outdated Show resolved Hide resolved
Copy link
Member

@anton-trunov anton-trunov left a comment

Choose a reason for hiding this comment

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

Just one small step

src/types/resolveStatements.ts Outdated Show resolved Hide resolved
@anton-trunov anton-trunov merged commit 213bf42 into tact-lang:main Sep 25, 2024
15 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.

Add logical assignment operators &&= and ||=
3 participants