Skip to content

Commit

Permalink
Fix up some documented exceptions (dotnet#108896)
Browse files Browse the repository at this point in the history
* fix up some exceptions

* change EII exceptions too
  • Loading branch information
gewarren authored Nov 8, 2024
1 parent 2f24ac9 commit 39afeec
Showing 1 changed file with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ private ImmutableList(Node root)
/// no larger element, the bitwise complement of <see cref="ImmutableList{T}.Count"/>.
/// </returns>
/// <exception cref="ArgumentOutOfRangeException">
/// <paramref name="index"/> is less than 0.-or-<paramref name="count"/> is less than 0.
/// <para><paramref name="index"/> is less than 0.</para>
/// <para>-or-</para>
/// <para><paramref name="count"/> is less than 0.</para>
/// </exception>
/// <exception cref="ArgumentException">
/// <paramref name="index"/> and <paramref name="count"/> do not denote a valid range in the <see cref="ImmutableList{T}"/>.
Expand Down Expand Up @@ -167,15 +169,15 @@ private ImmutableList(Node root)
/// </summary>
/// <param name="index">The 0-based index of the element in the set to return.</param>
/// <returns>The element at the given position.</returns>
/// <exception cref="IndexOutOfRangeException">Thrown from getter when <paramref name="index"/> is negative or not less than <see cref="Count"/>.</exception>
/// <exception cref="ArgumentOutOfRangeException"><paramref name="index"/> is negative or not less than <see cref="Count"/>.</exception>
public T this[int index] => _root.ItemRef(index);

/// <summary>
/// Gets a read-only reference to the element of the set at the given index.
/// </summary>
/// <param name="index">The 0-based index of the element in the set to return.</param>
/// <returns>A read-only reference to the element at the given position.</returns>
/// <exception cref="IndexOutOfRangeException">Thrown when <paramref name="index"/> is negative or not less than <see cref="Count"/>.</exception>
/// <exception cref="ArgumentOutOfRangeException"><paramref name="index"/> is negative or not less than <see cref="Count"/>.</exception>
public ref readonly T ItemRef(int index) => ref _root.ItemRef(index);

#endregion
Expand Down Expand Up @@ -927,14 +929,14 @@ IEnumerator<T> IEnumerable<T>.GetEnumerator()
/// Removes the value at the specified index.
/// </summary>
/// <param name="index">The index.</param>
/// <exception cref="NotSupportedException">Always thrown.</exception>
/// <exception cref="NotSupportedException">In all cases.</exception>
void IList<T>.RemoveAt(int index) => throw new NotSupportedException();

/// <summary>
/// Gets or sets the value at the specified index.
/// </summary>
/// <exception cref="IndexOutOfRangeException">Thrown from getter when <paramref name="index"/> is negative or not less than <see cref="Count"/>.</exception>
/// <exception cref="NotSupportedException">Always thrown from the setter.</exception>
/// <exception cref="ArgumentOutOfRangeException"><paramref name="index"/> is negative or not less than <see cref="Count"/> (getter).</exception>
/// <exception cref="NotSupportedException">In all cases from the setter.</exception>
T IList<T>.this[int index]
{
get => this[index];
Expand Down Expand Up @@ -1052,7 +1054,7 @@ T IList<T>.this[int index]
/// Removes the first occurrence of a specific object from the <see cref="IList"/>.
/// </summary>
/// <param name="value">The object to remove from the <see cref="IList"/>.</param>
/// <exception cref="NotSupportedException">Always thrown.</exception>
/// <exception cref="NotSupportedException">In all cases.</exception>
void IList.Remove(object? value) => throw new NotSupportedException();

/// <summary>
Expand All @@ -1063,8 +1065,8 @@ T IList<T>.this[int index]
/// </value>
/// <param name="index">The index.</param>
/// <returns>The value at the specified index.</returns>
/// <exception cref="IndexOutOfRangeException">Thrown from getter when <paramref name="index"/> is negative or not less than <see cref="Count"/>.</exception>
/// <exception cref="NotSupportedException">Always thrown from the setter.</exception>
/// <exception cref="ArgumentOutOfRangeException"><paramref name="index"/> is negative or not less than <see cref="Count"/> (getter).</exception>
/// <exception cref="NotSupportedException">In call cases from the setter.</exception>
object? IList.this[int index]
{
get => this[index];
Expand Down

0 comments on commit 39afeec

Please sign in to comment.