-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Extensions: proposal to use type inference during lookup #9126
Conversation
Co-authored-by: Jan Jones <[email protected]>
|
||
My proposal is that the implementation continue to diverge from the spec: instead of doing 2-phase lookup | ||
(as described in the section above, where we find compatible substituted extension containers, then find the candidate members in those) | ||
we could do a 1-phase lookup. We would only do this in invocation scenarios (ie. when arguments are provided). |
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.
At this point should we just update the spec with the compiler behavior? If the behavior is so ingrained we can't change it with classic extension methods and will continue it for extension members, instead of it being a spec deviation maybe we change the spec to reflect the implementation.
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.
(otherwise we should document it in https://github.com/dotnet/roslyn/blob/main/docs/compilers/CSharp/Deviations%20from%20Standard.md ?)
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.
We'll discuss this topic in LDM tomorrow.
FWIW, I have an issue tracking the discrepancy between spec and compiler here: dotnet/csharpstandard#1203 (we'll convert to roslyn issue if we decide to adjust implementation or document deviation instead of updating spec).
Relates to test plan dotnet/roslyn#76130