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: allow constant/trait constants depend on each other #1622

Conversation

i582
Copy link
Contributor

@i582 i582 commented Jan 29, 2025

Issue

Closes #924
Closes #1645

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

@i582 i582 added this to the v1.6.0 milestone Jan 29, 2025
@i582 i582 requested a review from jeshecdom January 29, 2025 07:37
@i582 i582 marked this pull request as ready for review January 29, 2025 07:37
@i582 i582 requested a review from a team as a code owner January 29, 2025 07:37
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.

@jeshecdom please review the interpreter changes

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.

What error message will you get if you do something like this?

contract Test {

    a: Int = 1;
    const B: Int = 10;
    const A: Int = self.B + self.test();
    
    fun test(): Int {
        return self.a;
    }
}

@jeshecdom
Copy link
Contributor

I think this PR should be put on hold after issue #1655 is resolved first, because it is related to constant initialization.

@anton-trunov anton-trunov merged commit 3d6616c into main Jan 31, 2025
24 checks passed
@anton-trunov anton-trunov deleted the pmakhne/support-self-constants-as-initializer-of-another-self-constant branch January 31, 2025 21:29
sansx pushed a commit to TownSquareXYZ/tact that referenced this pull request Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants