-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Labels
Pri3Indicates issues/PRs that are low priorityIndicates issues/PRs that are low priorityarea-System.RuntimeuntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner
Description
Example of what it looks like today (see bottom line of documentation):
// .........
// Exceptions:
// T:System.ArgumentNullException:
// array is null. -or- match is null.
//
// T:System.ArgumentOutOfRangeException:
// startIndex is outside the range of valid indexes for array.
public static int FindIndex<T>(T[] array, int startIndex, Predicate<T> match);
It effectively says that the method accepts [0 <= startIndex < Length] with Length exclusive.
But what the method actually accepts is [0 <= startIndex <= Length] with Length inclusive.
The real behavior of the startIndex is identical to String.Substring, which has the following description instead:
// T:System.ArgumentOutOfRangeException:
// startIndex is less than zero or greater than the length of this instance.
To be correct and easy to understand the FindIndex documentation should thus say:
// startIndex is less than zero or greater than the length of the array.
Metadata
Metadata
Assignees
Labels
Pri3Indicates issues/PRs that are low priorityIndicates issues/PRs that are low priorityarea-System.RuntimeuntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner