-
Notifications
You must be signed in to change notification settings - Fork 60
Add failing tests for ADT type inference #134
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
Conversation
As discussed in #131. Some explanations for my reasoning these are type inference bugs:
|
5809e5d
to
c9dc595
Compare
I'll tinker with these tests a bit. |
The rule is that matching on an ADT either deconstructs, in which case you don't qualify the cases, or it is a type-case, in which you need to write full types. It doesn't currently do unification on the target type of a type-case, maybe it should.
This is the unification thing above, it can't figure out the type argument. This test had other bugs; the C case cannot be arbitrarily re-used across different instantiations of A.
They aren't the same types.
|
I mean it would make it less verbose, so definitely better for developer UX.
Ah right. Interesting. Variants don't get passed by reference, I forgot.
That's fair. I checked with Rust and yeah I must have been misremembering because an equivalent program does not compile in Rust as well. |
No description provided.