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

fix: remove the destructuring fields quantity check in interpreter #969

Merged
merged 12 commits into from
Nov 6, 2024

Conversation

Gusarich
Copy link
Member

Issue

Closes #968.

Checklist

  • I have updated CHANGELOG.md
  • [ ] 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 added this to the v1.6.0 milestone Oct 16, 2024
@Gusarich Gusarich requested a review from a team as a code owner October 16, 2024 22:18
@Gusarich Gusarich changed the title fix: destructuring fix: remove the destructuring fields quantity check in interpreter Oct 16, 2024
@anton-trunov anton-trunov self-assigned this Oct 17, 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.

Let's add the previously failing test case from the linked issue

Copy link
Contributor

@jeshecdom jeshecdom left a comment

Choose a reason for hiding this comment

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

Regarding issue

src/interpreter.ts Show resolved Hide resolved
@anton-trunov
Copy link
Member

@Gusarich Let's finish this PR asap, please

@Gusarich Gusarich force-pushed the fix-destructuring branch 2 times, most recently from ea99e54 to 4b9e402 Compare October 24, 2024 12:03
novusnota
novusnota previously approved these changes Oct 24, 2024
Copy link
Member

@novusnota novusnota left a comment

Choose a reason for hiding this comment

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

src/grammar/grammar.ohm Outdated Show resolved Hide resolved
src/grammar/ast.ts Outdated Show resolved Hide resolved
src/grammar/test/stmt-destructuring.tact Outdated Show resolved Hide resolved
Copy link
Contributor

@jeshecdom jeshecdom left a comment

Choose a reason for hiding this comment

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

Tests LGTM. 👍

@Gusarich
Copy link
Member Author

Gusarich commented Nov 3, 2024

@anton-trunov have a look please!

src/prettyPrinter.ts Outdated Show resolved Hide resolved
@anton-trunov
Copy link
Member

Looks good to me. Let's merge the current version and then make one more iteration for v1.6 with the generalized destructuring, so we can do nested destructs

@anton-trunov anton-trunov merged commit 794c651 into tact-lang:main Nov 6, 2024
15 checks passed
github-actions bot pushed a commit to TownSquareXYZ/tact that referenced this pull request Nov 7, 2024
* remove the destructuring fields quantity check in interpreter

* feat(typechecker): check variables count
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.

destructuring of less fields than are in struct throws an error from interpreter
4 participants