Skip to content

Commit 03f16f1

Browse files
Fix triple slash documentation for System/System.Numerics (#76103)
* Add missing inheritdocs for TryParse * Fix documentation for UInt128/Int128.ToString * Revert "Fix documentation for UInt128/Int128.ToString" This reverts commit f18cfa7. * Apply suggestions from dotnet-api-docs review * Fix TryParse documentation for Int128/UInt128 * Fix BigInteger.TryParse docs * Fix NFloat.TryParse documentation * Fix *.Item documentation issues * Fix 'Tries to parses' typo * Apply suggestions from code review * Apply suggestions from code review Co-authored-by: Carlos Sanchez <1175054+carlossanlop@users.noreply.github.com> Co-authored-by: Carlos Sanchez <1175054+carlossanlop@users.noreply.github.com>
1 parent 4f81bb5 commit 03f16f1

File tree

14 files changed

+54
-8
lines changed

14 files changed

+54
-8
lines changed

src/libraries/System.Private.CoreLib/src/System/Half.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ public static Half Parse(ReadOnlySpan<char> s, NumberStyles style = DefaultParse
340340
}
341341

342342
/// <summary>
343-
/// Tries to parses a <see cref="Half"/> from a <see cref="string"/> in the default parse style.
343+
/// Tries to parse a <see cref="Half"/> from a <see cref="string"/> in the default parse style.
344344
/// </summary>
345345
/// <param name="s">The input to be parsed.</param>
346346
/// <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>
@@ -356,7 +356,7 @@ public static bool TryParse([NotNullWhen(true)] string? s, out Half result)
356356
}
357357

358358
/// <summary>
359-
/// Tries to parses a <see cref="Half"/> from a <see cref="ReadOnlySpan{Char}"/> in the default parse style.
359+
/// Tries to parse a <see cref="Half"/> from a <see cref="ReadOnlySpan{Char}"/> in the default parse style.
360360
/// </summary>
361361
/// <param name="s">The input to be parsed.</param>
362362
/// <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>

src/libraries/System.Private.CoreLib/src/System/IParsable.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public interface IParsable<TSelf>
1919
/// <exception cref="OverflowException"><paramref name="s" /> is not representable by <typeparamref name="TSelf" />.</exception>
2020
static abstract TSelf Parse(string s, IFormatProvider? provider);
2121

22-
/// <summary>Tries to parses a string into a value.</summary>
22+
/// <summary>Tries to parse a string into a value.</summary>
2323
/// <param name="s">The string to parse.</param>
2424
/// <param name="provider">An object that provides culture-specific formatting information about <paramref name="s" />.</param>
2525
/// <param name="result">On return, contains the result of successfully parsing <paramref name="s" /> or an undefined value on failure.</param>

src/libraries/System.Private.CoreLib/src/System/ISpanParsable.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public interface ISpanParsable<TSelf> : IParsable<TSelf>
1818
/// <exception cref="OverflowException"><paramref name="s" /> is not representable by <typeparamref name="TSelf" />.</exception>
1919
static abstract TSelf Parse(ReadOnlySpan<char> s, IFormatProvider? provider);
2020

21-
/// <summary>Tries to parses a span of characters into a value.</summary>
21+
/// <summary>Tries to parse a span of characters into a value.</summary>
2222
/// <param name="s">The span of characters to parse.</param>
2323
/// <param name="provider">An object that provides culture-specific formatting information about <paramref name="s" />.</param>
2424
/// <param name="result">On return, contains the result of successfully parsing <paramref name="s" /> or an undefined value on failure.</param>

src/libraries/System.Private.CoreLib/src/System/IntPtr.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,11 @@ public static bool TryParse(ReadOnlySpan<char> s, out nint result)
242242
return nint_t.TryParse(s, out Unsafe.As<nint, nint_t>(ref result));
243243
}
244244

245+
/// <summary>Tries to parse a string into a value.</summary>
246+
/// <param name="s">A read-only span of characters containing a number to convert.</param>
247+
/// <param name="provider">An object that provides culture-specific formatting information about <paramref name="s" />.</param>
248+
/// <param name="result">When this method returns, contains the result of successfully parsing <paramref name="s" /> or an undefined value on failure.</param>
249+
/// <returns><see langword="true" /> if <paramref name="s" /> was converted successfully; otherwise, <see langword="false" />.</returns>
245250
public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out nint result)
246251
{
247252
Unsafe.SkipInit(out result);

src/libraries/System.Private.CoreLib/src/System/Numerics/INumberBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ protected static abstract bool TryConvertToTruncating<TOther>(TSelf value, [Mayb
330330
where TOther : INumberBase<TOther>;
331331
#nullable restore
332332

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

342-
/// <summary>Tries to parses a span of characters into a value.</summary>
342+
/// <summary>Tries to parse a span of characters into a value.</summary>
343343
/// <param name="s">The span of characters to parse.</param>
344344
/// <param name="style">A bitwise combination of number styles that can be present in <paramref name="s" />.</param>
345345
/// <param name="provider">An object that provides culture-specific formatting information about <paramref name="s" />.</param>

src/libraries/System.Private.CoreLib/src/System/Numerics/Matrix3x2.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,15 @@ public static Matrix3x2 Identity
6868
get => _identity;
6969
}
7070

71+
/// <summary>Gets or sets the element at the specified indices.</summary>
72+
/// <param name="row">The index of the row containing the element to get or set.</param>
73+
/// <param name="column">The index of the column containing the element to get or set.</param>
74+
/// <returns>The element at [<paramref name="row" />][<paramref name="column" />].</returns>
75+
/// <exception cref="ArgumentOutOfRangeException">
76+
/// <paramref name="row" /> was less than zero or greater than the number of rows.
77+
/// -or-
78+
/// <paramref name="column" /> was less than zero or greater than the number of columns.
79+
/// </exception>
7180
public unsafe float this[int row, int column]
7281
{
7382
get

src/libraries/System.Private.CoreLib/src/System/Numerics/Matrix4x4.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,15 @@ public static Matrix4x4 Identity
152152
get => _identity;
153153
}
154154

155+
/// <summary>Gets or sets the element at the specified indices.</summary>
156+
/// <param name="row">The index of the row containing the element to get or set.</param>
157+
/// <param name="column">The index of the column containing the element to get or set.</param>
158+
/// <returns>The element at [<paramref name="row" />][<paramref name="column" />].</returns>
159+
/// <exception cref="ArgumentOutOfRangeException">
160+
/// <paramref name="row" /> was less than zero or greater than the number of rows.
161+
/// -or-
162+
/// <paramref name="column" /> was less than zero or greater than the number of columns.
163+
/// </exception>
155164
public unsafe float this[int row, int column]
156165
{
157166
get

src/libraries/System.Private.CoreLib/src/System/Numerics/Quaternion.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ public static Quaternion Identity
6868
get => new Quaternion(0, 0, 0, 1);
6969
}
7070

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

100104
/// <summary>Sets the element at the specified index.</summary>
101-
/// <param name="quaternion">The vector of the element to get.</param>
105+
/// <param name="quaternion">The vector of the element to set.</param>
102106
/// <param name="index">The index of the element to set.</param>
103107
/// <param name="value">The value of the element to set.</param>
104108
/// <exception cref="ArgumentOutOfRangeException"><paramref name="index" /> was less than zero or greater than the number of elements.</exception>

src/libraries/System.Private.CoreLib/src/System/Numerics/Vector2.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ public static Vector2 UnitY
8686
get => new Vector2(0.0f, 1.0f);
8787
}
8888

89+
/// <summary>Gets or sets the element at the specified index.</summary>
90+
/// <param name="index">The index of the element to get or set.</param>
91+
/// <returns>The the element at <paramref name="index" />.</returns>
92+
/// <exception cref="ArgumentOutOfRangeException"><paramref name="index" /> was less than zero or greater than the number of elements.</exception>
8993
public float this[int index]
9094
{
9195
get => GetElement(this, index);

src/libraries/System.Private.CoreLib/src/System/Numerics/Vector3.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ public static Vector3 UnitZ
106106
get => new Vector3(0.0f, 0.0f, 1.0f);
107107
}
108108

109+
/// <summary>Gets or sets the element at the specified index.</summary>
110+
/// <param name="index">The index of the element to get or set.</param>
111+
/// <returns>The the element at <paramref name="index" />.</returns>
112+
/// <exception cref="ArgumentOutOfRangeException"><paramref name="index" /> was less than zero or greater than the number of elements.</exception>
109113
public float this[int index]
110114
{
111115
get => GetElement(this, index);

src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ public static Vector4 UnitW
128128
get => new Vector4(0.0f, 0.0f, 0.0f, 1.0f);
129129
}
130130

131+
/// <summary>Gets or sets the element at the specified index.</summary>
132+
/// <param name="index">The index of the element to get or set.</param>
133+
/// <returns>The the element at <paramref name="index" />.</returns>
134+
/// <exception cref="ArgumentOutOfRangeException"><paramref name="index" /> was less than zero or greater than the number of elements.</exception>
131135
public float this[int index]
132136
{
133137
get => GetElement(this, index);

src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NFloat.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1763,6 +1763,7 @@ private static bool TryConvertTo<TOther>(NFloat value, [MaybeNullWhen(false)] ou
17631763
// IParsable
17641764
//
17651765

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

17681769
//

src/libraries/System.Private.CoreLib/src/System/UIntPtr.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,11 @@ public static bool TryParse([NotNullWhen(true)] string? s, out nuint result)
219219
return nuint_t.TryParse(s, out Unsafe.As<nuint, nuint_t>(ref result));
220220
}
221221

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

245+
/// <inheritdoc cref="IParsable{TSelf}.TryParse(string?, IFormatProvider?, out TSelf)" />
241246
public static bool TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, out nuint result)
242247
{
243248
Unsafe.SkipInit(out result);

src/libraries/System.Runtime.Numerics/src/System/Numerics/BigInteger.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5199,6 +5199,7 @@ static bool INumberBase<BigInteger>.TryConvertToTruncating<TOther>(BigInteger va
51995199
// IParsable
52005200
//
52015201

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

52045205
//

0 commit comments

Comments
 (0)