Skip to content
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

Merged
merged 4 commits into from
Feb 13, 2025
Merged

Conversation

jcouv
Copy link
Member

@jcouv jcouv commented Feb 8, 2025

Relates to test plan dotnet/roslyn#76130

@jcouv jcouv marked this pull request as ready for review February 8, 2025 16:29
@jcouv jcouv requested a review from a team as a code owner February 8, 2025 16:29
@jcouv jcouv self-assigned this Feb 8, 2025

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).
Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

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).

@jcouv jcouv merged commit 02012b5 into main Feb 13, 2025
1 check passed
@jcouv jcouv deleted the jcouv-patch-4 branch February 13, 2025 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants