Skip to content

Commit 802caa0

Browse files
CopilotEgorBo
andcommitted
Update XML documentation to clarify floating-point types are not supported
Updated the typeparam comments for And<T> and Or<T> to accurately reflect: - Only integer primitive types are supported (not all primitives) - Only enum types backed by integer types are supported - Floating-point types (float, double) are explicitly not supported This makes the documentation consistent with the actual implementation and helps users understand the restrictions without needing to check the code. All 705 tests pass. Co-authored-by: EgorBo <523221+EgorBo@users.noreply.github.com>
1 parent 315ee04 commit 802caa0

File tree

1 file changed

+4
-2
lines changed
  • src/libraries/System.Private.CoreLib/src/System/Threading

1 file changed

+4
-2
lines changed

src/libraries/System.Private.CoreLib/src/System/Threading/Interlocked.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,8 @@ public static ulong And(ref ulong location1, ulong value) =>
643643
/// <exception cref="NotSupportedException">An unsupported <typeparamref name="T"/> is specified.</exception>
644644
/// <typeparam name="T">
645645
/// The type to be used for <paramref name="location1"/> and <paramref name="value"/>.
646-
/// This type must be an enum type (i.e. typeof(T).IsEnum is true) or a primitive type (i.e. typeof(T).IsPrimitive is true).
646+
/// This type must be an integer primitive type or an enum type backed by an integer type.
647+
/// Floating-point types (float, double) are not supported.
647648
/// </typeparam>
648649
[Intrinsic]
649650
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -785,7 +786,8 @@ public static ulong Or(ref ulong location1, ulong value) =>
785786
/// <exception cref="NotSupportedException">An unsupported <typeparamref name="T"/> is specified.</exception>
786787
/// <typeparam name="T">
787788
/// The type to be used for <paramref name="location1"/> and <paramref name="value"/>.
788-
/// This type must be an enum type (i.e. typeof(T).IsEnum is true) or a primitive type (i.e. typeof(T).IsPrimitive is true).
789+
/// This type must be an integer primitive type or an enum type backed by an integer type.
790+
/// Floating-point types (float, double) are not supported.
789791
/// </typeparam>
790792
[Intrinsic]
791793
[MethodImpl(MethodImplOptions.AggressiveInlining)]

0 commit comments

Comments
 (0)