Skip to content

Conversation

jcouv
Copy link
Member

@jcouv jcouv commented Sep 3, 2025

Addresses part of #78967 ("We want unqualified CREF to work within the context of enclosing static type cref="extension(int).M"")
Relates to test plan #76130

@jcouv jcouv self-assigned this Sep 3, 2025
@jcouv jcouv added Area-Compilers Feature - Extension Everything The extension everything feature labels Sep 3, 2025
@jcouv jcouv marked this pull request as ready for review September 3, 2025 16:35
@jcouv jcouv requested a review from a team as a code owner September 3, 2025 16:35
foreach (var nested in container.GetTypeMembers())
IEnumerable<NamedTypeSymbol> candidateTypes = containerOpt switch
{
null => enumerateCandidateTypes(containerOpt, syntax, diagnostics),
Copy link
Member

@jjonescz jjonescz Sep 4, 2025

Choose a reason for hiding this comment

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

Why do we pass containerOpt when we know at this point that it's always null? #Resolved

{
CompoundUseSiteInfo<AssemblySymbol> useSiteInfo = GetNewCompoundUseSiteInfo(diagnostics);
LookupResult result = LookupResult.GetInstance();
this.LookupSymbolsOrMembersInternal(
Copy link
Contributor

@AlekseyTs AlekseyTs Sep 5, 2025

Choose a reason for hiding this comment

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

LookupSymbolsOrMembersInternal

It is not obvious what we are trying to accomplish by doing a lookup for an empty name. Why do we even need to use LookupSymbolsOrMembersInternal? #Closed

LookupResult result = LookupResult.GetInstance();
this.LookupSymbolsOrMembersInternal(
result,
container,
Copy link
Contributor

@AlekseyTs AlekseyTs Sep 5, 2025

Choose a reason for hiding this comment

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

container

It looks like this is always null. #Closed

foreach (var nested in container.GetTypeMembers())
IEnumerable<NamedTypeSymbol> candidateTypes = containerOpt switch
{
null => enumerateCandidateTypes(containerOpt, syntax, diagnostics),
Copy link
Contributor

@AlekseyTs AlekseyTs Sep 5, 2025

Choose a reason for hiding this comment

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

enumerateCandidateTypes(containerOpt, syntax, diagnostics),

this.ContainingType?.GetTypeMembers("") ?? []? #Closed

@@ -63,6 +63,7 @@ private MultiDictionary<string, TypeParameterSymbol> CreateTypeParameterMap()
case SyntaxKind.IndexerMemberCref:
case SyntaxKind.OperatorMemberCref:
case SyntaxKind.ConversionOperatorMemberCref:
case SyntaxKind.ExtensionMemberCref:
Copy link
Contributor

@AlekseyTs AlekseyTs Sep 5, 2025

Choose a reason for hiding this comment

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

case SyntaxKind.ExtensionMemberCref:

Is this change related to "Addresses part of #78967 ("We want unqualified CREF to work within the context of enclosing static type cref="extension(int).M"")"? If not, consider adjusting PR description accordingly. #Closed

@@ -63,6 +63,7 @@ private MultiDictionary<string, TypeParameterSymbol> CreateTypeParameterMap()
case SyntaxKind.IndexerMemberCref:
case SyntaxKind.OperatorMemberCref:
case SyntaxKind.ConversionOperatorMemberCref:
case SyntaxKind.ExtensionMemberCref:
Copy link
Contributor

@AlekseyTs AlekseyTs Sep 5, 2025

Choose a reason for hiding this comment

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

case SyntaxKind.ExtensionMemberCref:

Is there a test covering method type parameters for this case? #Closed

Copy link
Member Author

Choose a reason for hiding this comment

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

Added Cref_66

@AlekseyTs
Copy link
Contributor

AlekseyTs commented Sep 5, 2025

Done with review pass (commit 1) #Closed

@jcouv jcouv requested a review from AlekseyTs September 5, 2025 10:35
Copy link
Contributor

@AlekseyTs AlekseyTs left a comment

Choose a reason for hiding this comment

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

LGTM (commit 2)

@jcouv jcouv merged commit 01e03c2 into dotnet:main Sep 7, 2025
24 checks passed
@jcouv jcouv deleted the extensions-cref branch September 7, 2025 04:54
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Sep 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Feature - Extension Everything The extension everything feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants