Skip to content

Fix triple slash documentation for System/System.Numerics #76103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Oct 5, 2022
Merged
4 changes: 2 additions & 2 deletions src/libraries/System.Private.CoreLib/src/System/Half.cs
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ public static Half Parse(ReadOnlySpan<char> s, NumberStyles style = DefaultParse
}

/// <summary>
/// Tries to parses a <see cref="Half"/> from a <see cref="string"/> in the default parse style.
/// Tries to parse a <see cref="Half"/> from a <see cref="string"/> in the default parse style.
/// </summary>
/// <param name="s">The input to be parsed.</param>
/// <param name="result">The equivalent <see cref="Half"/> value representing the input string if the parse was successful. If the input exceeds Half's range, a <see cref="Half.PositiveInfinity"/> or <see cref="Half.NegativeInfinity"/> is returned. If the parse was unsuccessful, a default <see cref="Half"/> value is returned.</param>
Expand All @@ -356,7 +356,7 @@ public static bool TryParse([NotNullWhen(true)] string? s, out Half result)
}

/// <summary>
/// Tries to parses a <see cref="Half"/> from a <see cref="ReadOnlySpan{Char}"/> in the default parse style.
/// Tries to parse a <see cref="Half"/> from a <see cref="ReadOnlySpan{Char}"/> in the default parse style.
/// </summary>
/// <param name="s">The input to be parsed.</param>
/// <param name="result">The equivalent <see cref="Half"/> value representing the input string if the parse was successful. If the input exceeds Half's range, a <see cref="Half.PositiveInfinity"/> or <see cref="Half.NegativeInfinity"/> is returned. If the parse was unsuccessful, a default <see cref="Half"/> value is returned.</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public interface IParsable<TSelf>
/// <exception cref="OverflowException"><paramref name="s" /> is not representable by <typeparamref name="TSelf" />.</exception>
static abstract TSelf Parse(string s, IFormatProvider? provider);

/// <summary>Tries to parses a string into a value.</summary>
/// <summary>Tries to parse a string into a value.</summary>
/// <param name="s">The string to parse.</param>
/// <param name="provider">An object that provides culture-specific formatting information about <paramref name="s" />.</param>
/// <param name="result">On return, contains the result of successfully parsing <paramref name="s" /> or an undefined value on failure.</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public interface ISpanParsable<TSelf> : IParsable<TSelf>
/// <exception cref="OverflowException"><paramref name="s" /> is not representable by <typeparamref name="TSelf" />.</exception>
static abstract TSelf Parse(ReadOnlySpan<char> s, IFormatProvider? provider);

/// <summary>Tries to parses a span of characters into a value.</summary>
/// <summary>Tries to parse a span of characters into a value.</summary>
/// <param name="s">The span of characters to parse.</param>
/// <param name="provider">An object that provides culture-specific formatting information about <paramref name="s" />.</param>
/// <param name="result">On return, contains the result of successfully parsing <paramref name="s" /> or an undefined value on failure.</param>
Expand Down
5 changes: 5 additions & 0 deletions src/libraries/System.Private.CoreLib/src/System/IntPtr.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,11 @@ public static bool TryParse(ReadOnlySpan<char> s, out nint result)
return nint_t.TryParse(s, out Unsafe.As<nint, nint_t>(ref result));
}

/// <summary>Tries to parse a string into a value.</summary>
/// <param name="s">A read-only span of characters containing a number to convert.</param>
/// <param name="provider">An object that provides culture-specific formatting information about <paramref name="s" />.</param>
/// <param name="result">When this method returns, contains the result of successfully parsing <paramref name="s" /> or an undefined value on failure.</param>
/// <returns><see langword="true" /> if <paramref name="s" /> was converted successfully; otherwise, <see langword="false" />.</returns>
public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out nint result)
{
Unsafe.SkipInit(out result);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ protected static abstract bool TryConvertToTruncating<TOther>(TSelf value, [Mayb
where TOther : INumberBase<TOther>;
#nullable restore

/// <summary>Tries to parses a string into a value.</summary>
/// <summary>Tries to parse a string into a value.</summary>
/// <param name="s">The string to parse.</param>
/// <param name="style">A bitwise combination of number styles that can be present in <paramref name="s" />.</param>
/// <param name="provider">An object that provides culture-specific formatting information about <paramref name="s" />.</param>
Expand All @@ -339,7 +339,7 @@ protected static abstract bool TryConvertToTruncating<TOther>(TSelf value, [Mayb
/// <exception cref="ArgumentException"><paramref name="style" /> is not a supported <see cref="NumberStyles" /> value.</exception>
static abstract bool TryParse([NotNullWhen(true)] string? s, NumberStyles style, IFormatProvider? provider, out TSelf result);

/// <summary>Tries to parses a span of characters into a value.</summary>
/// <summary>Tries to parse a span of characters into a value.</summary>
/// <param name="s">The span of characters to parse.</param>
/// <param name="style">A bitwise combination of number styles that can be present in <paramref name="s" />.</param>
/// <param name="provider">An object that provides culture-specific formatting information about <paramref name="s" />.</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ public static Matrix3x2 Identity
get => _identity;
}

/// <summary>Gets or sets the element at the specified indices.</summary>
/// <param name="row">The index of the row containing the element to get or set.</param>
/// <param name="column">The index of the column containing the element to get or set.</param>
/// <returns>The element at [<paramref name="row" />][<paramref name="column" />].</returns>
/// <exception cref="ArgumentOutOfRangeException">
/// <paramref name="row" /> was less than zero or greater than the number of rows.
/// -or-
/// <paramref name="column" /> was less than zero or greater than the number of columns.
/// </exception>
public unsafe float this[int row, int column]
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,15 @@ public static Matrix4x4 Identity
get => _identity;
}

/// <summary>Gets or sets the element at the specified indices.</summary>
/// <param name="row">The index of the row containing the element to get or set.</param>
/// <param name="column">The index of the column containing the element to get or set.</param>
/// <returns>The element at [<paramref name="row" />][<paramref name="column" />].</returns>
/// <exception cref="ArgumentOutOfRangeException">
/// <paramref name="row" /> was less than zero or greater than the number of rows.
/// -or-
/// <paramref name="column" /> was less than zero or greater than the number of columns.
/// </exception>
public unsafe float this[int row, int column]
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ public static Quaternion Identity
get => new Quaternion(0, 0, 0, 1);
}

/// <summary>Gets or sets the element at the specified index.</summary>
/// <param name="index">The index of the element to get or set.</param>
/// <returns>The element at <paramref name="index" />.</returns>
/// <exception cref="ArgumentOutOfRangeException"><paramref name="index" /> was less than zero or greater than the number of elements.</exception>
public float this[int index]
{
get => GetElement(this, index);
Expand Down Expand Up @@ -98,7 +102,7 @@ private static float GetElementUnsafe(ref Quaternion quaternion, int index)
}

/// <summary>Sets the element at the specified index.</summary>
/// <param name="quaternion">The vector of the element to get.</param>
/// <param name="quaternion">The vector of the element to set.</param>
/// <param name="index">The index of the element to set.</param>
/// <param name="value">The value of the element to set.</param>
/// <exception cref="ArgumentOutOfRangeException"><paramref name="index" /> was less than zero or greater than the number of elements.</exception>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ public static Vector2 UnitY
get => new Vector2(0.0f, 1.0f);
}

/// <summary>Gets or sets the element at the specified index.</summary>
/// <param name="index">The index of the element to get or set.</param>
/// <returns>The the element at <paramref name="index" />.</returns>
/// <exception cref="ArgumentOutOfRangeException"><paramref name="index" /> was less than zero or greater than the number of elements.</exception>
public float this[int index]
{
get => GetElement(this, index);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ public static Vector3 UnitZ
get => new Vector3(0.0f, 0.0f, 1.0f);
}

/// <summary>Gets or sets the element at the specified index.</summary>
/// <param name="index">The index of the element to get or set.</param>
/// <returns>The the element at <paramref name="index" />.</returns>
/// <exception cref="ArgumentOutOfRangeException"><paramref name="index" /> was less than zero or greater than the number of elements.</exception>
public float this[int index]
{
get => GetElement(this, index);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ public static Vector4 UnitW
get => new Vector4(0.0f, 0.0f, 0.0f, 1.0f);
}

/// <summary>Gets or sets the element at the specified index.</summary>
/// <param name="index">The index of the element to get or set.</param>
/// <returns>The the element at <paramref name="index" />.</returns>
/// <exception cref="ArgumentOutOfRangeException"><paramref name="index" /> was less than zero or greater than the number of elements.</exception>
public float this[int index]
{
get => GetElement(this, index);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1763,6 +1763,7 @@ private static bool TryConvertTo<TOther>(NFloat value, [MaybeNullWhen(false)] ou
// IParsable
//

/// <inheritdoc cref="IParsable{TSelf}.TryParse(string?, IFormatProvider?, out TSelf)" />
public static bool TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, out NFloat result) => TryParse(s, NumberStyles.Float | NumberStyles.AllowThousands, provider, out result);

//
Expand Down
7 changes: 6 additions & 1 deletion src/libraries/System.Private.CoreLib/src/System/UIntPtr.cs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,11 @@ public static bool TryParse([NotNullWhen(true)] string? s, out nuint result)
return nuint_t.TryParse(s, out Unsafe.As<nuint, nuint_t>(ref result));
}

/// <inheritdoc cref="IParsable{TSelf}.TryParse(string?, IFormatProvider?, out TSelf)" />
/// <summary>Tries to parse a string into a value.</summary>
/// <param name="s">A read-only span of characters containing a number to convert.</param>
/// <param name="provider">An object that provides culture-specific formatting information about <paramref name="s" />.</param>
/// <param name="result">When this method returns, contains the result of successfully parsing <paramref name="s" /> or an undefined value on failure.</param>
/// <returns><see langword="true" /> if <paramref name="s" /> was converted successfully; otherwise, <see langword="false" />.</returns>
public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out nuint result)
{
Unsafe.SkipInit(out result);
Expand All @@ -238,6 +242,7 @@ public static bool TryParse(ReadOnlySpan<char> s, out nuint result)
return nuint_t.TryParse(s, out Unsafe.As<nuint, nuint_t>(ref result));
}

/// <inheritdoc cref="IParsable{TSelf}.TryParse(string?, IFormatProvider?, out TSelf)" />
public static bool TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, out nuint result)
{
Unsafe.SkipInit(out result);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5199,6 +5199,7 @@ static bool INumberBase<BigInteger>.TryConvertToTruncating<TOther>(BigInteger va
// IParsable
//

/// <inheritdoc cref="IParsable{TSelf}.TryParse(string?, IFormatProvider?, out TSelf)" />
public static bool TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, out BigInteger result) => TryParse(s, NumberStyles.Integer, provider, out result);

//
Expand Down