Skip to content

Extension indexers: bind CREF - #82012

Merged
jcouv merged 3 commits into
dotnet:features/extensionsfrom
jcouv:indexers_03
Jan 16, 2026
Merged

jcouv merged 3 commits into
dotnet:features/extensionsfrom
jcouv:indexers_03

Conversation

@jcouv

@jcouv jcouv commented Jan 14, 2026

Copy link
Copy Markdown
Contributor

Relates to test plan #81505

@jcouv jcouv self-assigned this Jan 14, 2026
@jcouv
jcouv marked this pull request as ready for review January 15, 2026 04:45
@jcouv
jcouv requested a review from a team as a code owner January 15, 2026 04:45
@AlekseyTs

AlekseyTs commented Jan 15, 2026 •

Copy link
Copy Markdown
Contributor
        CheckFeatureAvailability(syntax, MessageID.IDS_FeatureExtensions, diagnostics);

Is this going to produce duplicate and a misleading warning for an indexer syntax and version ("next"-2)? #Closed


Refers to: src/Compilers/CSharp/Portable/Binder/Binder_Crefs.cs:226 in 404cca4. [](commit_id = 404cca4, deletion_comment = False)

else if (syntax.Member is IndexerMemberCrefSyntax indexerSyntax)
{
CheckFeatureAvailability(syntax, MessageID.IDS_FeatureExtensionIndexers, diagnostics);
memberName = WellKnownMemberNames.Indexer;

@AlekseyTs AlekseyTs Jan 15, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

memberName = WellKnownMemberNames.Indexer;

Does this work with an indexer with custom name? Including metadata scenario. #Closed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The PE symbol name remains "this[]". Updated IndexerName test to cover meatadata scenario

        /// <remarks>
        /// To facilitate lookup, all indexer symbols have the same name.
        /// Check the MetadataName property to find the name we imported.
        /// </remarks>
        public override string Name
        {
            get { return this.IsIndexer ? WellKnownMemberNames.Indexer : _name; }
        }

@AlekseyTs

AlekseyTs commented Jan 15, 2026 •

Copy link
Copy Markdown
Contributor

Done with review pass (commit 1) #Closed

@jcouv
jcouv requested a review from AlekseyTs January 15, 2026 22:32

@AlekseyTs AlekseyTs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM (commit 3)

@jcouv
jcouv merged commit 9bee8a1 into dotnet:features/extensions Jan 16, 2026
24 checks passed
@jcouv
jcouv deleted the indexers_03 branch January 16, 2026 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants