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

Constrain flex inference variables without re-generalization #4560

Merged
merged 5 commits into from
Nov 23, 2022

Conversation

ayazhafiz
Copy link
Member

When constraining a recursive function like

f : _ -> {}
f : \_ -> f {}

our first step is to solve the value type of f relative to its
annotation. We have to be careful that the inference variable in the
signature of f is not generalized until after the body of f is
solved. Otherwise, we end up admitting polymorphic recursion.

When constraining a recursive function like

```
f : _ -> {}
f : \_ -> f {}
```

our first step is to solve the value type of `f` relative to its
annotation. We have to be careful that the inference variable in the
signature of `f` is not generalized until after the body of `f` is
solved. Otherwise, we end up admitting polymorphic recursion.
@ayazhafiz ayazhafiz merged commit 0ac6fe7 into main Nov 23, 2022
@ayazhafiz ayazhafiz deleted the fix-gen-of-inferred-signature-var branch November 23, 2022 08:35
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