-
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
Bug in spec for better conversion from expression #14117
Comments
This issue is preventing the proposed spec approach for
from having the effect of causing out var arguments to ignore the corresponding parameter position. |
This appears to be mooted in the ECMA version. But the ECMA version has no concept of exactly matching expression. |
It looks like the implementation is intentional, we would want the following scenario compiling without errors and using the second overload:
|
Indeed. Moreover, we want to implement the ECMA spec instead of the old C# 4 spec, which is quoted above in the OP. |
Closing, as we are intending to use the ECMA spec as our base, and it does not have this problem. |
We cannot use the ECMA spec as our base, because it does not reflect the changes for "better betterness" that were done in C# 6.0. Instead, the ECMA spec needs to embrace the Microsoft spec when it gets updated for C# 6.0. I agree that there is a discrepancy between how "better betterness" was spec'ed and how it's implemented. The implementation is already in use, so unless there's a strong reason not to (I don't see any), we should go with what's implemented. That means adjusting the spec a bit, so that better conversion target is checked both when neither matches precisely, and when both do. Something like this:
|
@MadsTorgersen
from the prefix to the bulleted list. |
@MadsTorgersen That reopen the question if how you would like to handle |
Issue moved to dotnet/csharplang #363 via ZenHub |
The spec for better conversion from expression doesn't match the implementation. The spec says
but the implementation does
Specifically, if both match exactly, then we test for a better conversion target. This is what is implemented:
The text was updated successfully, but these errors were encountered: