-
Notifications
You must be signed in to change notification settings - Fork 118
experiment: use ctx dot instantiation #5560
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
base: master
Are you sure you want to change the base?
Conversation
…isplaying expected parameters
same as #5552 but merged with master --------- Co-authored-by: Kamil Listopad <[email protected]>
…laudio/inf-errors
src/mo_frontend/typing.ml
Outdated
ts, t_arg', t_ret' | ||
| _::_, None -> (* implicit, infer *) | ||
infer_call_instantiation env t1 ctx_dot tbs t_arg t_ret exp2 at t_expect_opt extra_subtype_problems | ||
match dot_full_inst with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this actually complete? The full instantiation might be too specific to match the other args?
I.e. if you had inferred with the arguments in hand, you might have chosen a different, weaker, instantiation to accommodate them as well as the receiver.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's "safe" in that it'll never infer anything non-principal, right? It might reject more programs than we accepted before. Maybe we could weaken this to a "second pass" in the error case in the future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, fixing parts of the instantiation early based on the receiver can be more restrictive.
If we want the same inference results for both dot and without dot syntax then we should not use the partial instantiation.
I'd like to explore an alternative of reporting better bimatch errors
No description provided.