-
Notifications
You must be signed in to change notification settings - Fork 119
experiment: track lowest upper bound and greatest lower bound potential errors #5678
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
| Bool | ||
| because there is no way to satisfy subtyping | ||
| Bool <: T (for argument `x`) | ||
| `T` inferred to `Int` but incompatible 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.
Where is the () coming from, the return type?
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.
the return type yes
| [var Nat] | ||
| because there is no way to satisfy subtyping | ||
| [var Nat] <: [var T] (for argument `x`) | ||
| `T` inferred to `()` but incompatible with `Nat` |
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.
Ditto
|
Maybe not worth the complexity? |
Joining two unrelated types (using
glborlub) is not an immediate error, just results inNonorAny.This can lead to loosing type information in errors, example:
Non <: T <: Anystarting pointNat <: T <: AnyglbwithNatAny <: T <: AnyglbwithText, we lost info aboutNatandTextNow,
lubwithFloatfails with an over-constrained error, but at this point we only know thatT := Anywhich is not helpful.This PR adds tracking of 'failed' glb/lub by checking whether their result the the appropriate extreme and adds this extra error info to the error message.
Here it would say
'T' inferred to 'Nat' but incompatible with 'Text'However, this PR is not that helpful in common cases where our current error handling is enough.
So I'm not sure if the extra complexity is worth it.