-
Notifications
You must be signed in to change notification settings - Fork 822
Inconsistent error message for incompatible return type in nested if / else #3146
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
Comments
This is very hard to do since you don't know how deep this goes. |
WIP: #3150 |
Would it be possible to use the same error messages in both places? I'm not really sure what "context type requirements" would mean to a newbie either. |
No we can't use the same error message. It's different reasons.
Am 30.05.2017 9:28 vorm. schrieb "Isaac Abraham" <[email protected]>:
… Would it be possible to use the same error messages in both places? I'm
not really sure what "context type requirements" would mean to a newbie
either.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3146 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADgNGr3MbIgO4qZ_C6zV9DN1FdVCKsiks5r-8UzgaJpZM4Non3f>
.
|
What are the different reasons? It's an expression that needs to give consistent results; one half returns bool and the other half returns some non-bool. Yes, it trickles down but why is it any different? |
as you can see in e2b9efd this evaluates the current context and passes the Else info down if we are already in else branch. |
This code correctly does not compile. However, the error messages across both branches in the inner if / else are not consistent: -
I would have expected both errors to be the same, using second version (the F#4.1 improved error message).
cc: @forki
The text was updated successfully, but these errors were encountered: