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

Investigate whether substitutions for type inference should be scoped #178

Open
umazalakain opened this issue May 28, 2021 · 0 comments
Open
Assignees
Labels
internals Changes to the internals of our compiler implementation

Comments

@umazalakain
Copy link
Contributor

Does the application of solutions need to be scoped? Add the following test case:

((dt1 : data) -> _x) _x
((dt2 : data) -> dt2) _x

inference creates a new type variable dt and substitutes dt1 |-> dt and dt2 |-> dt:

((dt : data) -> _x) _x
((dt : data) -> dt) _x

then inference creates a constraint _x ~ dt resulting in the substitution _x |-> dt applying this substitution globally gives

((dt : data) -> dt) dt
((dt : data) -> dt) dt

however note that here the function argument dt is not bound: the expression is ill-scoped.

@umazalakain umazalakain added the internals Changes to the internals of our compiler implementation label May 28, 2021
@umazalakain umazalakain self-assigned this May 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internals Changes to the internals of our compiler implementation
Projects
None yet
Development

No branches or pull requests

1 participant