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

Workaround for state vars from instances in incremental compilation (REPL) #1190

Merged
merged 4 commits into from
Sep 29, 2023

Conversation

bugarela
Copy link
Collaborator

@bugarela bugarela commented Sep 28, 2023

Hello :octocat:

Our new flattener process is still not done incrementally (#1103). This will likely be a hard problem to solve.

Because of the re-flattening on each REPL evaluation (since it is not incremental), definitions from instances get fresh ids on each evaluation. This includes state variables, and therefore we had a problem (reported by @p-offtermatt on slack) where the values for variables were not persisting between evaluations.

The solution, for now, is to re-map the references to state variables from the old id to the new one. We do this by using the variable name which, after flattening, is guaranteed to be unique.

  • Tests added for any new code
  • Documentation added for any new functionality
  • Entries added to the respective CHANGELOG.md for any new functionality
  • Feature table on README.md updated for any listed functionality

@bugarela bugarela self-assigned this Sep 28, 2023
@bugarela bugarela enabled auto-merge September 29, 2023 11:58
@bugarela bugarela merged commit 2f0e734 into main Sep 29, 2023
15 checks passed
@bugarela bugarela deleted the gabriela/fix-repl-instance-vars branch September 29, 2023 12:10
@bugarela bugarela mentioned this pull request Oct 2, 2023
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.

2 participants