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

Implement try-catch statements #212

Merged
merged 8 commits into from
Apr 22, 2024
Merged

Conversation

Gusarich
Copy link
Member

@Gusarich Gusarich commented Mar 29, 2024

Closes #209

  • I have updated CHANGELOG.md
  • I have added unit tests to demonstrate the contribution is correctly implemented
  • I have run all the tests locally and no test failure was reported
  • I did not introduce unrelated formatting/whitespace changes in the code base
  • I did not do unrelated and/or undiscussed refactorings

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.

This is a very nice feature! It needs to be properly tested, though: please see the comments below

src/test/features/try-catch.tact Show resolved Hide resolved
src/test/features/try-catch.tact Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
src/types/resolveStatements.ts Show resolved Hide resolved
src/generator/writers/writeFunction.ts Outdated Show resolved Hide resolved
src/test/feature-try-catch.spec.ts Outdated Show resolved Hide resolved
@anton-trunov anton-trunov added this to the v1.3.0 milestone Apr 2, 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 a negative typechecker test with the case when the type of the catch-variable is not Int

src/types/resolveStatements.ts Outdated Show resolved Hide resolved
src/types/resolveStatements.ts Outdated Show resolved Hide resolved
@Gusarich
Copy link
Member Author

Let's add a negative typechecker test with the case when the type of the catch-variable is not Int

how exactly can it be not Int?

@anton-trunov
Copy link
Member

how exactly can it be not Int?

@Gusarich try to use it in a context where it is not Int, for instance as a string

@anton-trunov
Copy link
Member

There are some merge conflicts that need to be resolved

@Gusarich
Copy link
Member Author

@anton-trunov I think that's it!

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.

Perfect!

@anton-trunov anton-trunov merged commit b9dd1b8 into tact-lang:main Apr 22, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Try-catch statements in Tact
3 participants