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(docs): explain how storage variables get updated #1311

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

novusnota
Copy link
Member

@novusnota novusnota commented Jan 14, 2025

Issue

Closes #1095.

Checklist

  • I have updated CHANGELOG.md (needs correction)
  • I have run the linter, formatter and spellchecker
  • I did not do unrelated and/or undiscussed refactorings

@novusnota novusnota added this to the Doc: 2025-01 milestone Jan 14, 2025
@novusnota novusnota requested a review from a team as a code owner January 14, 2025 04:29
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 PR does not resolve #1095, to actually resolve it you need to incorporate and expand this comment:

#712 (comment)

It looks like this PR is trying to resolve #713

Comment on lines +228 to +241
The default value of [state variables](#variables) is assigned before any values could be assigned in the `init(){:tact}` function.

```tact
contract Example {
// persistent state variables
var1: Int = 0; // initialized with default value 0

// constructor function
init() {
self.var1 = 42; // overrides the default to 42
}
}
```

Copy link
Member

Choose a reason for hiding this comment

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

This looks like a duplicate of the example above

Copy link
Member Author

Choose a reason for hiding this comment

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

That was the intent, but yeah, I'll remove it

@novusnota
Copy link
Member Author

novusnota commented Jan 14, 2025

This PR does not resolve #1095, to actually resolve it you need to incorporate and expand this comment:

#712 (comment)

Sure, I'll add more while removing the redundancies.

It looks like this PR is trying to resolve #713

Well, it wasn't labeled as a doc issue, but as a testing & typechecker, so I don't think this PR needs to be marked as closing it.

@anton-trunov anton-trunov self-assigned this Jan 14, 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
Development

Successfully merging this pull request may close these issues.

Explain how storage variables get updated
2 participants