Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/libraries/System.Private.CoreLib/src/System/Decimal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1813,6 +1813,7 @@ private static bool TryConvertTo<TOther>(decimal value, [MaybeNullWhen(false)] o
// IParsable
//

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

//
Expand Down
1 change: 1 addition & 0 deletions src/libraries/System.Private.CoreLib/src/System/Double.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1411,6 +1411,7 @@ private static bool TryConvertTo<TOther>(double 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 double result) => TryParse(s, NumberStyles.Float | NumberStyles.AllowThousands, provider, out result);

//
Expand Down
20 changes: 9 additions & 11 deletions src/libraries/System.Private.CoreLib/src/System/Enum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,10 @@ public static Array GetValues(Type enumType)
/// </summary>
/// <typeparam name="TEnum">An enumeration type.</typeparam>
/// /// <remarks>
/// This method can be used to get enumeration values when creating an array of the enumeration type is challenging.
/// For example, <see cref="T:System.Reflection.MetadataLoadContext" /> or on a platform where runtime codegen is not available.
/// You can use this method to get enumeration values when it's hard to create an array of the enumeration type.
/// For example, you might use this method for the <see cref="T:System.Reflection.MetadataLoadContext" /> enumeration or on a platform where run-time code generation is not available.
/// </remarks>
/// <returns>An array that contains the values of the underlying type constants in enumType.</returns>
/// <returns>An array that contains the values of the underlying type constants in <typeparamref name="TEnum" />.</returns>
public static Array GetValuesAsUnderlyingType<TEnum>() where TEnum : struct, Enum =>
typeof(TEnum).GetEnumValuesAsUnderlyingType();

Expand All @@ -339,16 +339,14 @@ public static Array GetValuesAsUnderlyingType<TEnum>() where TEnum : struct, Enu
/// </summary>
/// <param name="enumType">An enumeration type.</param>
/// <remarks>
/// This method can be used to get enumeration values when creating an array of the enumeration type is challenging.
/// For example, <see cref="T:System.Reflection.MetadataLoadContext" /> or on a platform where runtime codegen is not available.
/// You can use this method to get enumeration values when it's hard to create an array of the enumeration type.
/// For example, you might use this method for the <see cref="T:System.Reflection.MetadataLoadContext" /> enumeration or on a platform where run-time code generation is not available.
/// </remarks>
/// <returns>An array that contains the values of the underlying type constants in <paramref name="enumType" />.</returns>
/// <exception cref="ArgumentNullException">
/// Thrown when the enumeration type is null.
/// </exception>
/// <exception cref="ArgumentException">
/// Thrown when the type is not an enumeration type.
/// </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="enumType" /> is null.</exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="enumType" /> is not an enumeration type.</exception>
public static Array GetValuesAsUnderlyingType(Type enumType)
{
ArgumentNullException.ThrowIfNull(enumType);
Expand Down
1 change: 1 addition & 0 deletions src/libraries/System.Private.CoreLib/src/System/Half.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1888,6 +1888,7 @@ private static bool TryConvertTo<TOther>(Half value, [MaybeNullWhen(false)] out
// IParsable
//

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

//
Expand Down
1 change: 1 addition & 0 deletions src/libraries/System.Private.CoreLib/src/System/Int128.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2013,6 +2013,7 @@ static bool INumberBase<Int128>.TryConvertToTruncating<TOther>(Int128 value, [Ma
// IParsable
//

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

//
Expand Down
1 change: 1 addition & 0 deletions src/libraries/System.Private.CoreLib/src/System/Int16.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1355,6 +1355,7 @@ static bool INumberBase<short>.TryConvertToTruncating<TOther>(short value, [Mayb
// IParsable
//

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

//
Expand Down
1 change: 1 addition & 0 deletions src/libraries/System.Private.CoreLib/src/System/Int32.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1367,6 +1367,7 @@ static bool INumberBase<int>.TryConvertToTruncating<TOther>(int value, [MaybeNul
// IParsable
//

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

//
Expand Down
1 change: 1 addition & 0 deletions src/libraries/System.Private.CoreLib/src/System/Int64.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1360,6 +1360,7 @@ static bool INumberBase<long>.TryConvertToTruncating<TOther>(long value, [MaybeN
// IParsable
//

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

//
Expand Down
1 change: 1 addition & 0 deletions src/libraries/System.Private.CoreLib/src/System/IntPtr.cs
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ public static bool TryParse([NotNullWhen(true)] string? s, out nint result)
return nint_t.TryParse(s, out Unsafe.As<nint, nint_t>(ref result));
}

/// <inheritdoc cref="IParsable{TSelf}.TryParse(string?, IFormatProvider?, out TSelf)" />
public static bool TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, out nint result)
{
Unsafe.SkipInit(out result);
Expand Down
1 change: 1 addition & 0 deletions src/libraries/System.Private.CoreLib/src/System/SByte.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1320,6 +1320,7 @@ static bool INumberBase<sbyte>.TryConvertToTruncating<TOther>(sbyte value, [Mayb
// IParsable
//

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

//
Expand Down
1 change: 1 addition & 0 deletions src/libraries/System.Private.CoreLib/src/System/Single.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1391,6 +1391,7 @@ private static bool TryConvertTo<TOther>(float value, [MaybeNullWhen(false)] out
// IParsable
//

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

//
Expand Down
12 changes: 5 additions & 7 deletions src/libraries/System.Private.CoreLib/src/System/Type.cs
Original file line number Diff line number Diff line change
Expand Up @@ -527,16 +527,14 @@ public virtual Array GetEnumValues()
}

/// <summary>
/// Retrieves an array of the values of the underlying type constants in a specified enumeration type.
/// Retrieves an array of the values of the underlying type constants of this enumeration type.
/// </summary>
/// <remarks>
/// This method can be used to get enumeration values when creating an array of the enumeration type is challenging.
/// For example, <see cref="T:System.Reflection.MetadataLoadContext" /> or on a platform where runtime codegen is not available.
/// You can use this method to get enumeration values when it's hard to create an array of the enumeration type.
/// For example, you might use this method for the <see cref="T:System.Reflection.MetadataLoadContext" /> enumeration or on a platform where run-time code generation is not available.
/// </remarks>
/// <returns>An array that contains the values of the underlying type constants in enumType.</returns>
/// <exception cref="ArgumentException">
/// Thrown when the type is not an enumeration type.
/// </exception>
/// <returns>An array that contains the values of the underlying type constants in this enumeration type.</returns>
/// <exception cref="T:System.ArgumentException">This type is not an enumeration type.</exception>
public virtual Array GetEnumValuesAsUnderlyingType() => throw new NotSupportedException(SR.NotSupported_SubclassOverride);

[RequiresDynamicCode("The code for an array of the specified type might not be available.")]
Expand Down
1 change: 1 addition & 0 deletions src/libraries/System.Private.CoreLib/src/System/UInt128.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2023,6 +2023,7 @@ static bool INumberBase<UInt128>.TryConvertToTruncating<TOther>(UInt128 value, [
// IParsable
//

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

//
Expand Down
1 change: 1 addition & 0 deletions src/libraries/System.Private.CoreLib/src/System/UInt16.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1170,6 +1170,7 @@ static bool INumberBase<ushort>.TryConvertToTruncating<TOther>(ushort value, [Ma
// IParsable
//

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

//
Expand Down
1 change: 1 addition & 0 deletions src/libraries/System.Private.CoreLib/src/System/UInt32.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1179,6 +1179,7 @@ static bool INumberBase<uint>.TryConvertToTruncating<TOther>(uint value, [MaybeN
// IParsable
//

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

//
Expand Down
1 change: 1 addition & 0 deletions src/libraries/System.Private.CoreLib/src/System/UInt64.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1172,6 +1172,7 @@ static bool INumberBase<ulong>.TryConvertToTruncating<TOther>(ulong value, [Mayb
// IParsable
//

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

//
Expand Down
1 change: 1 addition & 0 deletions src/libraries/System.Private.CoreLib/src/System/UIntPtr.cs
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ 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)" />
public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out nuint result)
{
Unsafe.SkipInit(out result);
Expand Down