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

Ensure that types derived for REPL expressions have no free type variables #16

Closed
julianhyde opened this issue Mar 3, 2020 · 1 comment

Comments

@julianhyde
Copy link
Collaborator

Ensure that types derived for REPL expressions have no free type variables. Currently the type resolver will return a type like 'a list -> 'a, which has a free type variable. When that value is applied to a value, say an int, the type of the result will be wrongly given as 'a when it should be int.

The solution is to wrap the derived type in a ForallType if there are any free type variables.

As part of the solution, add class TypeVisitor and method Type.accept(TypeVisitor).

@julianhyde
Copy link
Collaborator Author

Fixed in 8a553d8.

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

No branches or pull requests

1 participant