-
Notifications
You must be signed in to change notification settings - Fork 844
Better error message when a record was given #1283
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
3de5768 to
9dd67f4
Compare
|
ok the error shows this is harder than expected. |
5b03bf3 to
41266e9
Compare
|
ready for review |
|
@forki @dsyme Please see samples below for reasoning. So to introduce the bug, it is that the argument to doSomething is not a list: We see that for the first error we get a clear actionable accurate message: But the other two entries, give a bogus error message: |
|
Yes, I thought about raising a proper type unification error. But it wasn't
|
|
a small bit of background: the issue is that In the last bit we then see that In the sample with |
|
Ok I managed to make it a type unification error, but this change needs more review. My strategy: If we can't resolve to the given overallTy then we might just try to resolve to any record type and let the type checker fail directly after label resolution. I think this should work and should actually give the good error. |
|
fixed |
fixes #1280