-
-
Notifications
You must be signed in to change notification settings - Fork 609
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
don't pretend we found a match #1842
Conversation
|
This is a bad patch: void foo()
{
}
void main()
{
foo("");
}There are no overloads here. There are no overloads in diag9420.d which you've modified either. And again you didn't add any test-cases... |
|
What's wrong with the error message? It looks right on target to me. The test cases already exist - diag9420.d is an example. |
It used to be: |
|
Yes, I know what it used to be. The second message is either redundant or very misleading, because the previous code would just "pick any" in the event of overload resolution failure, and then you'd get a weird message based on trying to match up with that "any" function. |
|
Hmm, did some new update of Phobos break this? |
|
Yes, my Phobos pull was bad but I just reverted it, all should be fine soon enough. |
But there is no other symbol to pick, there are no overloads of |
|
The error message is fine. I really don't understand what the problem is. |
void foo(int, int, int)
{
}
void main()
{
foo(1, 2.0, 3);
}Before your pull: After: Why get rid of the informative error message? |
|
As I said before,
|
|
Well ok, but I hope nobody files a regression. |
|
Yes you can extract the information manually but why should you? When there is only one overload, the second error is never wrong. Is it that hard to keep it in that case? |
|
Ok, spot the mismatch: Not perfect, but it helps.
No argument there. Just don't get rid of the non-bogus error.
Sure, and if it had no matches from multiple overloads, the error message is less helpful. If it had no matches from a single function, the second error is helpful. |
|
|
Less redundant error messages are good and actually help to find a bug in your program. I don't want to waste my time checking two error messages instead of one, so the patch is perfectly nice in my opinion. |
|
I think this is reasonable change. The second error "expected 0 arguments, not 1 for non-variadic function" is redundant (At minimum it should be "supplemental" error). |
|
This pull request may have introduced a regression: |
Changed it so it does not attempt to recover from function overload errors by picking one essentially at random. Now it marks the call as invalid.