Skip to content

C#: Extract indexer when accessing a span with a range.#21877

Draft
michaelnebel wants to merge 10 commits into
github:mainfrom
michaelnebel:csharp/spanaccessrange
Draft

C#: Extract indexer when accessing a span with a range.#21877
michaelnebel wants to merge 10 commits into
github:mainfrom
michaelnebel:csharp/spanaccessrange

Conversation

@michaelnebel
Copy link
Copy Markdown
Contributor

@michaelnebel michaelnebel commented May 21, 2026

Improves the extraction of span range-access expressions (such as a[0..3]).

Roslyn translates a[0..3] into a.Slice(0,3) for spans (and something similar for strings). In this PR we introduce some special handling in the extractor for such cases and still consider a[0..3] as indexer calls (as this most closely resembles the syntax).

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.

1 participant