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
Add "Hint:" to a suggestion message related to coercion failures #1501
Conversation
While we are at it, would you maybe give an example of what a double coercion is (in case people don't know) in the error message, "using a double coercion (foo : bar :> baz)."? |
Good idea. I added a commit that does that. |
typing/typecore.ml
Outdated
"This simple coercion was not fully general." | ||
"Consider using a double coercion." | ||
"Hint: Consider using a double coercion" | ||
"(of the form: `(foo : ty1 :> ty2)')." |
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 removing the parentheses around of the form: '...'
would make the whole thing more readable.
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.
like now?
Good to merge as soon as we stop rebasing for long enough that the CI passes -- the old message may be present in test reference files, so it's not completely obvious that it does. |
I know it wasn't added by this PR, but could we use a better term than "double coercion"? It implies that something is being coerced twice, which isn't the case. Looking through the manual there doesn't seem to be an particular name used for this operator. How about "fully explicit coercion"? |
I added an other commit that implements @lpw25 suggestion. |
Is the CI stuck or something? |
AppVeyor seems stuck, but I'm not too worried about this PR breaking Windows while Travis tests pass. I think this is good to merge. Do you think that you should squash the commits? |
I just squashed the commits. |
Here be dragons, and non-updated config/Makefile.m* madness. Although there still seems to be an occasional race condition in the AppVeyor parallel script which I should look into, which I think is more the problem here. |
The goal is to consistently mark suggestions in error messages with "Hint:", as already done with the spellcheck suggestion and the missing rec suggestion.
This change was suggested by @garrigue ; since it's only a one line change i'm not sure a Changes entry is needed..?