-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Better Betterness is not that better #8942
Comments
Isn't this what #250 (bestest betterness) is supposed to fix? |
Just noting the equivalent VB.NET code has worked since at least VS2013. |
Chatted with @gafter and this is indeed an example of the bestest betterness discussion. In particular point 3:
Going to let the language design issue track this for now. It's on our candidate list for an upcoming version |
Additionally, it has issues with Linq.
However slightly changing the code works:
|
@jaredpar Actually, now that I think about it further it might not be the same. This is a lambda conversion, not a method group conversion. I'll note to look at that too when we look at bestest betterness. |
@gafter the most recent comment is a lambda conversion. The original question is about method group conversions. |
Consider following example
Compilation produces after #6560 fix error message
CS0121: The call is ambiguous between the following methods or properties: 'BrokenOverloadResolution.Test(Action)' and 'BrokenOverloadResolution.Test(Func<object>)'
but there is no ambiguity.Removing "ambiguous" candidate
static void Test (Action a)
leads to real compilation error which sayserror CS0407: 'void BrokenOverloadResolution.Listen()' has the wrong return type
which makes sense asvoid
is not convertible toobject
but that means there is no real ambiguity.Reading #7934 does not mentioned anything special about method group conversions with return type
void
.The text was updated successfully, but these errors were encountered: