-
Notifications
You must be signed in to change notification settings - Fork 26
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
Fix #311 #312
Fix #311 #312
Conversation
We should probably go over the whole typechecker and make sure we're not doing any double work (right now the string "does not match expect type" appears nine times in |
In what condition would the first guard of |
@albertnetymk: The simplest case I could think of is
Coercion is in practice used to figure out the type of
Not sure if it is currently possible to construct an example where the type parameter of a ref type is unknown and needs to be coerced, but if we had type inference of constructors one could imagine a
that was instantiated as
Here, we cannot know what
which in the first case of |
Wouldn't |
The whole idea of using |
|
I'm not sure what you mean by "using With that said, I still think the type checker would benefit from a do-over. |
I mean all that coercion-bottom stuff. |
OK, IOW, it's impossible to hit the first clause currently, then. Assuming we had constructor type inference, why is the
|
No, see my first example (
It's not. Your example wouldn't compile (although it should). But rather than trying to tack that case on (which doesn't have a use case yet), I would rather see a complete revamp of the type checking procedure. |
Yes, you are right. I forgot the The first clause of coerce should deal with but not limited to cases listed below:
so that type inference could exploit the type annotation. Currently, both the guard and body of the first clause fail to meet the requirement, and fixing them completely probably stipulates a full-scale improvement in TC, so maybe it's best to remove the first clause totally to avoid false sense of security and get fast failure if at all. |
Agreed! Pushed now |
In spite of my lobbying effort, there's still |
Fixed broken coercion that would lose type parameters when casting: