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

refactor(pipeline): move constant evaluation after typechecking #1678

Merged
merged 20 commits into from
Mar 3, 2025

Conversation

jeshecdom
Copy link
Contributor

Issue

Closes #1655.

Moves constant, default constract field and default struct field evaluation after typechecking to ensure that any function called during initialization has already typechecked.

This PR is required for PR #1652.

Checklist

  • I have updated CHANGELOG.md
  • 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

@jeshecdom jeshecdom requested a review from a team as a code owner February 3, 2025 10:43
@jeshecdom jeshecdom mentioned this pull request Feb 3, 2025
6 tasks
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.

What about evaluating message opcodes and getters' method_id?

@jeshecdom
Copy link
Contributor Author

What about evaluating message opcodes and getters' method_id?

Mmmm... good point. I did not consider that. I see that there are several other places in the typechecker where evalConstantExpression is called. I will need to check them in more detail.

@anton-trunov anton-trunov requested a review from i582 February 4, 2025 06:01
@anton-trunov anton-trunov changed the title refactor: Move constant, default contract field, and default struct field initialization after typechecking refactor(pipeline): move constant evaluation after typechecking Feb 4, 2025
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.

merge conflicts

@anton-trunov
Copy link
Member

merge conflicts

@novusnota novusnota added this to the v1.6.0 milestone Feb 11, 2025
@anton-trunov anton-trunov modified the milestones: v1.6.0, v1.7.0 Feb 18, 2025
@anton-trunov anton-trunov modified the milestones: v1.7.0, v1.6.1 Mar 2, 2025
@anton-trunov anton-trunov self-assigned this Mar 2, 2025
@anton-trunov
Copy link
Member

LGTM (modulo one question)

Let's also wait for a feedback from @i582

Copy link
Contributor

@i582 i582 left a comment

Choose a reason for hiding this comment

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

Looks good

@anton-trunov anton-trunov merged commit 739dc87 into main Mar 3, 2025
26 checks passed
@anton-trunov anton-trunov deleted the move-constant branch March 3, 2025 10:26
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.

Constant initialization must be moved after typechecking
4 participants