Skip to content

Unable to override SearchValues #114621

Answered by MihaZupan
JanTamis asked this question in Q&A
Apr 14, 2025 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

Yes, providing different implementations is intentionally restricted to .NET (CoreLib) itself.
This allows us to evolve the type easier without having to think about whether adding new APIs will break something for custom implementations.

If someone has better ideas around how something can be implemented, or more patterns we should consider special-casing, we're happy to consider including them into .NET itself.
Did you have anything like that in mind / why did you wish to override it?

In such cases the user also shouldn't be blocked by the lack of extensibility as a more specialized IndexOfAny-like implementation can easily live as an extenion method in user code.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@JanTamis
Comment options

@MihaZupan
Comment options

Answer selected by JanTamis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants