Skip to content

Fix 'cannot be saved' on emphemeral vars. #8024

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

Merged
merged 4 commits into from
Jul 15, 2025

Conversation

sovdeeth
Copy link
Member

@sovdeeth sovdeeth commented Jul 12, 2025

Problem

ephemeral variables are not saved, yet were emitting 'cannot save x' warnings.

Solution

Adds a ephemeral field that acts identically to how local variables are determined. Variable#isEphemeral() is the public api.
Moves the static ephemeral token field from Variables to Variable to match the local token field.

Testing Completed

manual confirmation.

Supporting Information


Completes: #8023
Related: none

@sovdeeth sovdeeth requested a review from a team as a code owner July 12, 2025 22:43
@sovdeeth sovdeeth requested review from Burbulinis and TheMug06 and removed request for a team July 12, 2025 22:43
@sovdeeth sovdeeth moved this to In Review in 2.12 Releases Jul 12, 2025
@sovdeeth sovdeeth linked an issue Jul 12, 2025 that may be closed by this pull request
1 task
@skriptlang-automation skriptlang-automation bot added the needs reviews A PR that needs additional reviews label Jul 12, 2025
@Absolutionism
Copy link
Contributor

Just out of curiosity, since ephemeral variables are enabled by default now. Would it not be better to have an “isEphemeral” method on Variable?

@sovdeeth
Copy link
Member Author

Just out of curiosity, since ephemeral variables are enabled by default now. Would it not be better to have an “isEphemeral” method on Variable?

yeah that's what i meant by making the api like local vars

@Absolutionism
Copy link
Contributor

yeah that's what i meant by making the api like local vars

ahh ok

@sovdeeth
Copy link
Member Author

actually thinking more about this I don't think this solution is ok at all due to the evaluation problem
I'll rework it to be a full fix of ephemeral vars tomorrow

@sovdeeth sovdeeth requested a review from a team as a code owner July 13, 2025 20:03
@sovdeeth sovdeeth requested review from UnderscoreTud and APickledWalrus and removed request for a team July 13, 2025 20:03
@sovdeeth sovdeeth added the bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. label Jul 13, 2025
@github-project-automation github-project-automation bot moved this from In Review to Awaiting Merge in 2.12 Releases Jul 15, 2025
@skriptlang-automation skriptlang-automation bot added feature-ready A PR/issue that has been approved, tested and can be merged/closed in the next feature version. and removed needs reviews A PR that needs additional reviews labels Jul 15, 2025
@sovdeeth sovdeeth merged commit d80b0bf into SkriptLang:dev/feature Jul 15, 2025
5 of 6 checks passed
@github-project-automation github-project-automation bot moved this from Awaiting Merge to Done in 2.12 Releases Jul 15, 2025
@skriptlang-automation skriptlang-automation bot added completed The issue has been fully resolved and the change will be in the next Skript update. and removed feature-ready A PR/issue that has been approved, tested and can be merged/closed in the next feature version. labels Jul 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. completed The issue has been fully resolved and the change will be in the next Skript update.
Projects
Status: Done - Released
Development

Successfully merging this pull request may close these issues.

Ephemeral variable 'can not be saved'
5 participants