You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Several MemoryExtensions.LastIndexOfAnyExcept overloads incorrectly document "first occurrence" #136282
The XML documentation for several MemoryExtensions.LastIndexOfAnyExcept<T> overloads contains contradictory wording.
The method summaries correctly state that the methods search for the last index. However, their <returns> sections incorrectly say that the returned index is the index of the first occurrence:
The index in the span of the first occurrence of any value other than those in <paramref name="values"/>.
first occurrence should be changed to last occurrence.
Affected APIs
LastIndexOfAnyExcept<T>(thisReadOnlySpan<T>span,ReadOnlySpan<T>values)where T :IEquatable<T>?LastIndexOfAnyExcept<T>(thisReadOnlySpan<T>span,ReadOnlySpan<T>values,IEqualityComparer<T>?comparer=null)
There may be additional overloads containing the same copied wording.
Reproduction Steps
Open System.MemoryExtensions in the dotnet/runtime repository.
Locate the XML documentation for the following overloads:
LastIndexOfAnyExcept<T>(thisReadOnlySpan<T>span,ReadOnlySpan<T>values)where T :IEquatable<T>?LastIndexOfAnyExcept<T>(thisReadOnlySpan<T>span,ReadOnlySpan<T>values,IEqualityComparer<T>?comparer=null)
Inspect the <returns> documentation.
Expected behavior
The <returns> documentation should state that the method returns the index of the last occurrence of a value.
Actual behavior
The <returns> documentation incorrectly states that the method returns the index of the first occurrence of a value.
Regression?
No known regression. This appears to be an existing XML documentation error.
Known Workarounds
No response
Configuration
Not configuration-specific. This issue affects the XML documentation in System.MemoryExtensions.
Activity
dotnet-policy-service commentedon Oct 22, 2026
Tagging subscribers to this area: @dotnet/area-system-memory
See info in area-owners.md if you want to be subscribed.
ehsan-raoufi commentedon Oct 24, 2026
Hi! I’d like to work on this issue. Is it available for contribution?
Fix Several MemoryExtensions.LastIndexOfAnyExcept overloads incorrect…