Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Several MemoryExtensions.LastIndexOfAnyExcept overloads incorrectly document "first occurrence"

Aperta Adatta ai principianti
#136,282 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
1/5
Tempo stimato
Meno di un'ora
Idoneità per principianti
83/100
Tipo di issue
Documentazione
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
csharp
Ambito
documentation

Direzione di ricerca

Apri la documentazione XML degli overload elencati di MemoryExtensions.LastIndexOfAnyExcept<T> in System.MemoryExtensions e cerca la frase “first occurrence”; controlla se gli overload vicini riportano la stessa formulazione copiata. Modifica il testo returns interessato in “last occurrence”, quindi verifica la formulazione corretta in tutti gli overload.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area-System.Memory untriaged
Description

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>(this ReadOnlySpan<T> span, ReadOnlySpan<T> values) where T : IEquatable<T>?

LastIndexOfAnyExcept<T>(this ReadOnlySpan<T> span, ReadOnlySpan<T> values, IEqualityComparer<T>? comparer = null)

There may be additional overloads containing the same copied wording.

Reproduction Steps
  1. Open System.MemoryExtensions in the dotnet/runtime repository.
  2. Locate the XML documentation for the following overloads:
LastIndexOfAnyExcept<T>(this ReadOnlySpan<T> span, ReadOnlySpan<T> values) where T : IEquatable<T>?

LastIndexOfAnyExcept<T>(this ReadOnlySpan<T> span, ReadOnlySpan<T> values, IEqualityComparer<T>? comparer = null)
  1. 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.

Other information

No response

Lingua principale
C#
Stelle
18.4k
Fork
5.7k
Merge medio
2g 19h
PR unite (30g)
649

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di dotnet/runtime

Tutte le issue di dotnet/runtime

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.