Skip to content

List pattern indexer resolution problematic #8540

Answered by elgonzo
elgonzo asked this question in Language Ideas
Discussion options

You must be logged in to vote

As it turns out (discussed in a different topic), the list pattern follows the already established precedent where for example using an index like [^1] would also call the object-based indexer but not the int-based indexer. I have no broader insight into the wider .NET ecosystem and developer community, and what it would effect if features like these were tidied up to make their behavior seem less surprising and arbitrary, so i leave it to the team what to do about it. Or likely not to do, considering that Index and Range are around already since the Core 3.0 days (and so is quite likely the behavior of favoring object-based indexers for them). While i have to admit that on a personal lev…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@elgonzo
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by elgonzo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants