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

Track scope properly when inferring values #869

Merged
merged 4 commits into from
Dec 18, 2023
Merged

Conversation

zth
Copy link
Collaborator

@zth zth commented Dec 17, 2023

This fixes an infinite loop bug that was cause by not tracking the scope properly as we infer values from unsaved content. All inference worked on the same, final scope, which led to infinite loops when adding a new binding to scope with a name that was already in scope.

Now, each value in scope tracks its own scope properly, and this fixes the bug.

@zth zth requested a review from cristianoc December 17, 2023 20:14
@zth zth changed the title add reproduction for infinite loop issue Track scope properly when inferring values Dec 18, 2023
@zth zth marked this pull request as ready for review December 18, 2023 13:39
Copy link
Collaborator

@cristianoc cristianoc left a comment

Choose a reason for hiding this comment

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

sweet

no chances of infinite loops left?


type t = item list

open SharedTypes.ScopeTypes
Copy link
Collaborator

Choose a reason for hiding this comment

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

where is this used?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah in the pattern matching below.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah exactly, I opened it just to have it function as it did before.

@zth
Copy link
Collaborator Author

zth commented Dec 18, 2023

sweet

no chances of infinite loops left?

Oh no idea lol. Probably. But at least not from this issue.

@zth zth merged commit e11dfe3 into master Dec 18, 2023
@zth zth deleted the infinite-loop-reprod branch December 18, 2023 17:27
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