-
Notifications
You must be signed in to change notification settings - Fork 52
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
Strange type checking error "Skolem variable would escape its scope" #2101
Comments
This is definitely a bug (although it is also, separately, true that the error message ought to be improved: #2102 ). |
OK, I think I understand what is going on here. Going to try writing out an explanation both to help organize my thoughts and in case anyone else finds it interesting.
Fixing this should be pretty easy --- we can modify the |
@byorgey so polymorphic type annotations are effectively only allowed at definition site? |
Yes, I think that's correct. If you have an example of a polymorphic type annotation somewhere other than at a definition site that you think would be useful, I'd love to see it. 😄 |
Describe the bug
Typechecking the following program gives a strange error:
because it uses a renamed type variable it is not immediately obvious what this is even about.
To Reproduce
Expected behavior
The error should use the original type variable name
a
and a less formal language to explain the issue.In this case there might not even be a reason for the error and it should typecheck.
Screenshots
It is interesting that only a part of the function body does not typecheck:
The text was updated successfully, but these errors were encountered: