diff --git a/Microsoft.Toolkit/Diagnostics/Attributes/DoesNotReturnAttribute.cs b/Microsoft.Toolkit/Attributes/DoesNotReturnAttribute.cs
similarity index 100%
rename from Microsoft.Toolkit/Diagnostics/Attributes/DoesNotReturnAttribute.cs
rename to Microsoft.Toolkit/Attributes/DoesNotReturnAttribute.cs
diff --git a/Microsoft.Toolkit/Diagnostics/Attributes/DoesNotReturnIfAttribute.cs b/Microsoft.Toolkit/Attributes/DoesNotReturnIfAttribute.cs
similarity index 100%
rename from Microsoft.Toolkit/Diagnostics/Attributes/DoesNotReturnIfAttribute.cs
rename to Microsoft.Toolkit/Attributes/DoesNotReturnIfAttribute.cs
diff --git a/Microsoft.Toolkit/Diagnostics/Attributes/NotNullAttribute.cs b/Microsoft.Toolkit/Attributes/NotNullAttribute.cs
similarity index 100%
rename from Microsoft.Toolkit/Diagnostics/Attributes/NotNullAttribute.cs
rename to Microsoft.Toolkit/Attributes/NotNullAttribute.cs
diff --git a/Microsoft.Toolkit/Diagnostics/Generated/ThrowHelper.Collection.g.cs b/Microsoft.Toolkit/Diagnostics/Generated/ThrowHelper.Collection.g.cs
index b0df73a80e3..1994b5fcc8c 100644
--- a/Microsoft.Toolkit/Diagnostics/Generated/ThrowHelper.Collection.g.cs
+++ b/Microsoft.Toolkit/Diagnostics/Generated/ThrowHelper.Collection.g.cs
@@ -16,16 +16,16 @@
namespace Microsoft.Toolkit.Diagnostics
{
///
- /// Helper methods to throw exceptions
+ /// Helper methods to efficiently throw exceptions.
///
- internal static partial class ThrowHelper
+ public static partial class ThrowHelper
{
///
/// Throws an when (or an overload) fails.
///
[MethodImpl(MethodImplOptions.NoInlining)]
[DoesNotReturn]
- public static void ThrowArgumentExceptionForIsEmpty(Span span, string name)
+ internal static void ThrowArgumentExceptionForIsEmpty(Span span, string name)
{
ThrowArgumentException(name, $"Parameter {name.ToAssertString()} ({typeof(Span).ToTypeString()}) must be empty, had a size of {span.Length.ToAssertString()}");
}
@@ -35,7 +35,7 @@ public static void ThrowArgumentExceptionForIsEmpty(Span span, string name
///
[MethodImpl(MethodImplOptions.NoInlining)]
[DoesNotReturn]
- public static void ThrowArgumentExceptionForHasSizeEqualTo(Span span, int size, string name)
+ internal static void ThrowArgumentExceptionForHasSizeEqualTo(Span span, int size, string name)
{
ThrowArgumentException(name, $"Parameter {name.ToAssertString()} ({typeof(Span).ToTypeString()}) must have a size equal to {size}, had a size of {span.Length.ToAssertString()}");
}
@@ -45,7 +45,7 @@ public static void ThrowArgumentExceptionForHasSizeEqualTo(Span span, int
///
[MethodImpl(MethodImplOptions.NoInlining)]
[DoesNotReturn]
- public static void ThrowArgumentExceptionForHasSizeNotEqualTo(Span span, int size, string name)
+ internal static void ThrowArgumentExceptionForHasSizeNotEqualTo(Span span, int size, string name)
{
ThrowArgumentException(name, $"Parameter {name.ToAssertString()} ({typeof(Span).ToTypeString()}) must have a size not equal to {size}, had a size of {span.Length.ToAssertString()}");
}
@@ -55,7 +55,7 @@ public static void ThrowArgumentExceptionForHasSizeNotEqualTo(Span span, i
///
[MethodImpl(MethodImplOptions.NoInlining)]
[DoesNotReturn]
- public static void ThrowArgumentExceptionForHasSizeGreaterThan(Span span, int size, string name)
+ internal static void ThrowArgumentExceptionForHasSizeGreaterThan(Span span, int size, string name)
{
ThrowArgumentException(name, $"Parameter {name.ToAssertString()} ({typeof(Span).ToTypeString()}) must have a size over {size}, had a size of {span.Length.ToAssertString()}");
}
@@ -65,7 +65,7 @@ public static void ThrowArgumentExceptionForHasSizeGreaterThan(Span span,
///
[MethodImpl(MethodImplOptions.NoInlining)]
[DoesNotReturn]
- public static void ThrowArgumentExceptionForHasSizeGreaterThanOrEqualTo(Span span, int size, string name)
+ internal static void ThrowArgumentExceptionForHasSizeGreaterThanOrEqualTo(Span span, int size, string name)
{
ThrowArgumentException(name, $"Parameter {name.ToAssertString()} ({typeof(Span).ToTypeString()}) must have a size of at least {size}, had a size of {span.Length.ToAssertString()}");
}
@@ -75,7 +75,7 @@ public static void ThrowArgumentExceptionForHasSizeGreaterThanOrEqualTo(Span<
///
[MethodImpl(MethodImplOptions.NoInlining)]
[DoesNotReturn]
- public static void ThrowArgumentExceptionForHasSizeLessThan(Span span, int size, string name)
+ internal static void ThrowArgumentExceptionForHasSizeLessThan(Span span, int size, string name)
{
ThrowArgumentException(name, $"Parameter {name.ToAssertString()} ({typeof(Span).ToTypeString()}) must have a size less than {size}, had a size of {span.Length.ToAssertString()}");
}
@@ -85,7 +85,7 @@ public static void ThrowArgumentExceptionForHasSizeLessThan(Span span, int
///
[MethodImpl(MethodImplOptions.NoInlining)]
[DoesNotReturn]
- public static void ThrowArgumentExceptionForHasSizeLessThanOrEqualTo(Span span, int size, string name)
+ internal static void ThrowArgumentExceptionForHasSizeLessThanOrEqualTo(Span span, int size, string name)
{
ThrowArgumentException(name, $"Parameter {name.ToAssertString()} ({typeof(Span).ToTypeString()}) must have a size less than or equal to {size}, had a size of {span.Length.ToAssertString()}");
}
@@ -95,7 +95,7 @@ public static void ThrowArgumentExceptionForHasSizeLessThanOrEqualTo(Span
///
[MethodImpl(MethodImplOptions.NoInlining)]
[DoesNotReturn]
- public static void ThrowArgumentExceptionForHasSizeEqualTo(Span source, Span destination, string name)
+ internal static void ThrowArgumentExceptionForHasSizeEqualTo(Span source, Span destination, string name)
{
ThrowArgumentException(name, $"The source {name.ToAssertString()} ({typeof(Span).ToTypeString()}) must have a size equal to {destination.Length.ToAssertString()} (the destination), had a size of {source.Length.ToAssertString()}");
}
@@ -105,7 +105,7 @@ public static void ThrowArgumentExceptionForHasSizeEqualTo(Span source, Sp
///
[MethodImpl(MethodImplOptions.NoInlining)]
[DoesNotReturn]
- public static void ThrowArgumentExceptionForHasSizeLessThanOrEqualTo(Span source, Span destination, string name)
+ internal static void ThrowArgumentExceptionForHasSizeLessThanOrEqualTo(Span source, Span destination, string name)
{
ThrowArgumentException(name, $"The source {name.ToAssertString()} ({typeof(Span).ToTypeString()}) must have a size less than or equal to {destination.Length.ToAssertString()} (the destination), had a size of {source.Length.ToAssertString()}");
}
@@ -115,9 +115,9 @@ public static void ThrowArgumentExceptionForHasSizeLessThanOrEqualTo(Span
///
[MethodImpl(MethodImplOptions.NoInlining)]
[DoesNotReturn]
- public static void ThrowArgumentOutOfRangeExceptionForIsInRangeFor(int index, Span span, string name)
+ internal static void ThrowArgumentOutOfRangeExceptionForIsInRangeFor(int index, Span span, string name)
{
- ThrowArgumentOutOfRangeException(name, $"Parameter {name.ToAssertString()} (int) must be in the range given by <0> and {span.Length.ToAssertString()} to be a valid index for the target collection ({typeof(Span).ToTypeString()}), was {index.ToAssertString()}");
+ ThrowArgumentOutOfRangeException(name, index, $"Parameter {name.ToAssertString()} (int) must be in the range given by <0> and {span.Length.ToAssertString()} to be a valid index for the target collection ({typeof(Span).ToTypeString()}), was {index.ToAssertString()}");
}
///
@@ -125,9 +125,9 @@ public static void ThrowArgumentOutOfRangeExceptionForIsInRangeFor(int index,
///
[MethodImpl(MethodImplOptions.NoInlining)]
[DoesNotReturn]
- public static void ThrowArgumentOutOfRangeExceptionForIsNotInRangeFor(int index, Span span, string name)
+ internal static void ThrowArgumentOutOfRangeExceptionForIsNotInRangeFor(int index, Span span, string name)
{
- ThrowArgumentOutOfRangeException(name, $"Parameter {name.ToAssertString()} (int) must not be in the range given by <0> and {span.Length.ToAssertString()} to be an invalid index for the target collection ({typeof(Span).ToTypeString()}), was {index.ToAssertString()}");
+ ThrowArgumentOutOfRangeException(name, index, $"Parameter {name.ToAssertString()} (int) must not be in the range given by <0> and {span.Length.ToAssertString()} to be an invalid index for the target collection ({typeof(Span).ToTypeString()}), was {index.ToAssertString()}");
}
///
@@ -135,7 +135,7 @@ public static void ThrowArgumentOutOfRangeExceptionForIsNotInRangeFor(int ind
///
[MethodImpl(MethodImplOptions.NoInlining)]
[DoesNotReturn]
- public static void ThrowArgumentExceptionForIsEmpty(ReadOnlySpan span, string name)
+ internal static void ThrowArgumentExceptionForIsEmpty(ReadOnlySpan span, string name)
{
ThrowArgumentException(name, $"Parameter {name.ToAssertString()} ({typeof(ReadOnlySpan).ToTypeString()}) must be empty, had a size of {span.Length.ToAssertString()}");
}
@@ -145,7 +145,7 @@ public static void ThrowArgumentExceptionForIsEmpty(ReadOnlySpan span, str
///
[MethodImpl(MethodImplOptions.NoInlining)]
[DoesNotReturn]
- public static void ThrowArgumentExceptionForHasSizeEqualTo(ReadOnlySpan span, int size, string name)
+ internal static void ThrowArgumentExceptionForHasSizeEqualTo(ReadOnlySpan span, int size, string name)
{
ThrowArgumentException(name, $"Parameter {name.ToAssertString()} ({typeof(ReadOnlySpan).ToTypeString()}) must have a size equal to {size}, had a size of {span.Length.ToAssertString()}");
}
@@ -155,7 +155,7 @@ public static void ThrowArgumentExceptionForHasSizeEqualTo(ReadOnlySpan sp
///
[MethodImpl(MethodImplOptions.NoInlining)]
[DoesNotReturn]
- public static void ThrowArgumentExceptionForHasSizeNotEqualTo(ReadOnlySpan span, int size, string name)
+ internal static void ThrowArgumentExceptionForHasSizeNotEqualTo(ReadOnlySpan span, int size, string name)
{
ThrowArgumentException(name, $"Parameter {name.ToAssertString()} ({typeof(ReadOnlySpan).ToTypeString()}) must have a size not equal to {size}, had a size of {span.Length.ToAssertString()}");
}
@@ -165,7 +165,7 @@ public static void ThrowArgumentExceptionForHasSizeNotEqualTo(ReadOnlySpan
///
[MethodImpl(MethodImplOptions.NoInlining)]
[DoesNotReturn]
- public static void ThrowArgumentExceptionForHasSizeGreaterThan(ReadOnlySpan span, int size, string name)
+ internal static void ThrowArgumentExceptionForHasSizeGreaterThan(ReadOnlySpan span, int size, string name)
{
ThrowArgumentException(name, $"Parameter {name.ToAssertString()} ({typeof(ReadOnlySpan).ToTypeString()}) must have a size over {size}, had a size of {span.Length.ToAssertString()}");
}
@@ -175,7 +175,7 @@ public static void ThrowArgumentExceptionForHasSizeGreaterThan(ReadOnlySpan
[MethodImpl(MethodImplOptions.NoInlining)]
[DoesNotReturn]
- public static void ThrowArgumentExceptionForHasSizeGreaterThanOrEqualTo(ReadOnlySpan span, int size, string name)
+ internal static void ThrowArgumentExceptionForHasSizeGreaterThanOrEqualTo(ReadOnlySpan span, int size, string name)
{
ThrowArgumentException(name, $"Parameter {name.ToAssertString()} ({typeof(ReadOnlySpan).ToTypeString()}) must have a size of at least {size}, had a size of {span.Length.ToAssertString()}");
}
@@ -185,7 +185,7 @@ public static void ThrowArgumentExceptionForHasSizeGreaterThanOrEqualTo(ReadO
///
[MethodImpl(MethodImplOptions.NoInlining)]
[DoesNotReturn]
- public static void ThrowArgumentExceptionForHasSizeLessThan(ReadOnlySpan span, int size, string name)
+ internal static void ThrowArgumentExceptionForHasSizeLessThan(ReadOnlySpan span, int size, string name)
{
ThrowArgumentException(name, $"Parameter {name.ToAssertString()} ({typeof(ReadOnlySpan).ToTypeString()}) must have a size less than {size}, had a size of {span.Length.ToAssertString()}");
}
@@ -195,7 +195,7 @@ public static void ThrowArgumentExceptionForHasSizeLessThan(ReadOnlySpan s
///
[MethodImpl(MethodImplOptions.NoInlining)]
[DoesNotReturn]
- public static void ThrowArgumentExceptionForHasSizeLessThanOrEqualTo(ReadOnlySpan span, int size, string name)
+ internal static void ThrowArgumentExceptionForHasSizeLessThanOrEqualTo(ReadOnlySpan span, int size, string name)
{
ThrowArgumentException(name, $"Parameter {name.ToAssertString()} ({typeof(ReadOnlySpan).ToTypeString()}) must have a size less than or equal to {size}, had a size of {span.Length.ToAssertString()}");
}
@@ -205,7 +205,7 @@ public static void ThrowArgumentExceptionForHasSizeLessThanOrEqualTo(ReadOnly
///
[MethodImpl(MethodImplOptions.NoInlining)]
[DoesNotReturn]
- public static void ThrowArgumentExceptionForHasSizeEqualTo(ReadOnlySpan source, Span destination, string name)
+ internal static void ThrowArgumentExceptionForHasSizeEqualTo(ReadOnlySpan source, Span destination, string name)
{
ThrowArgumentException(name, $"The source {name.ToAssertString()} ({typeof(ReadOnlySpan).ToTypeString()}) must have a size equal to {destination.Length.ToAssertString()} (the destination), had a size of {source.Length.ToAssertString()}");
}
@@ -215,7 +215,7 @@ public static void ThrowArgumentExceptionForHasSizeEqualTo(ReadOnlySpan so
///
[MethodImpl(MethodImplOptions.NoInlining)]
[DoesNotReturn]
- public static void ThrowArgumentExceptionForHasSizeLessThanOrEqualTo(ReadOnlySpan source, Span destination, string name)
+ internal static void ThrowArgumentExceptionForHasSizeLessThanOrEqualTo(ReadOnlySpan source, Span destination, string name)
{
ThrowArgumentException(name, $"The source {name.ToAssertString()} ({typeof(ReadOnlySpan).ToTypeString()}) must have a size less than or equal to {destination.Length.ToAssertString()} (the destination), had a size of {source.Length.ToAssertString()}");
}
@@ -225,9 +225,9 @@ public static void ThrowArgumentExceptionForHasSizeLessThanOrEqualTo(ReadOnly
///
[MethodImpl(MethodImplOptions.NoInlining)]
[DoesNotReturn]
- public static void ThrowArgumentOutOfRangeExceptionForIsInRangeFor(int index, ReadOnlySpan span, string name)
+ internal static void ThrowArgumentOutOfRangeExceptionForIsInRangeFor(int index, ReadOnlySpan span, string name)
{
- ThrowArgumentOutOfRangeException(name, $"Parameter {name.ToAssertString()} (int) must be in the range given by <0> and {span.Length.ToAssertString()} to be a valid index for the target collection ({typeof(ReadOnlySpan).ToTypeString()}), was {index.ToAssertString()}");
+ ThrowArgumentOutOfRangeException(name, index, $"Parameter {name.ToAssertString()} (int) must be in the range given by <0> and {span.Length.ToAssertString()} to be a valid index for the target collection ({typeof(ReadOnlySpan).ToTypeString()}), was {index.ToAssertString()}");
}
///
@@ -235,9 +235,9 @@ public static void ThrowArgumentOutOfRangeExceptionForIsInRangeFor(int index,
///
[MethodImpl(MethodImplOptions.NoInlining)]
[DoesNotReturn]
- public static void ThrowArgumentOutOfRangeExceptionForIsNotInRangeFor(int index, ReadOnlySpan span, string name)
+ internal static void ThrowArgumentOutOfRangeExceptionForIsNotInRangeFor(int index, ReadOnlySpan span, string name)
{
- ThrowArgumentOutOfRangeException(name, $"Parameter {name.ToAssertString()} (int) must not be in the range given by <0> and {span.Length.ToAssertString()} to be an invalid index for the target collection ({typeof(ReadOnlySpan).ToTypeString()}), was {index.ToAssertString()}");
+ ThrowArgumentOutOfRangeException(name, index, $"Parameter {name.ToAssertString()} (int) must not be in the range given by <0> and {span.Length.ToAssertString()} to be an invalid index for the target collection ({typeof(ReadOnlySpan).ToTypeString()}), was {index.ToAssertString()}");
}
///
@@ -245,7 +245,7 @@ public static void ThrowArgumentOutOfRangeExceptionForIsNotInRangeFor(int ind
///
[MethodImpl(MethodImplOptions.NoInlining)]
[DoesNotReturn]
- public static void ThrowArgumentExceptionForIsEmpty(Memory memory, string name)
+ internal static void ThrowArgumentExceptionForIsEmpty(Memory memory, string name)
{
ThrowArgumentException(name, $"Parameter {name.ToAssertString()} ({typeof(Memory).ToTypeString()}) must be empty, had a size of {memory.Length.ToAssertString()}");
}
@@ -255,7 +255,7 @@ public static void ThrowArgumentExceptionForIsEmpty(Memory memory, string
///
[MethodImpl(MethodImplOptions.NoInlining)]
[DoesNotReturn]
- public static void ThrowArgumentExceptionForHasSizeEqualTo(Memory memory, int size, string name)
+ internal static void ThrowArgumentExceptionForHasSizeEqualTo(Memory memory, int size, string name)
{
ThrowArgumentException(name, $"Parameter {name.ToAssertString()} ({typeof(Memory).ToTypeString()}) must have a size equal to {size}, had a size of {memory.Length.ToAssertString()}");
}
@@ -265,7 +265,7 @@ public static void ThrowArgumentExceptionForHasSizeEqualTo(Memory memory,
///
[MethodImpl(MethodImplOptions.NoInlining)]
[DoesNotReturn]
- public static void ThrowArgumentExceptionForHasSizeNotEqualTo(Memory memory, int size, string name)
+ internal static void ThrowArgumentExceptionForHasSizeNotEqualTo(Memory memory, int size, string name)
{
ThrowArgumentException(name, $"Parameter {name.ToAssertString()} ({typeof(Memory).ToTypeString()}) must have a size not equal to {size}, had a size of {memory.Length.ToAssertString()}");
}
@@ -275,7 +275,7 @@ public static void ThrowArgumentExceptionForHasSizeNotEqualTo(Memory memor
///
[MethodImpl(MethodImplOptions.NoInlining)]
[DoesNotReturn]
- public static void ThrowArgumentExceptionForHasSizeGreaterThan(Memory memory, int size, string name)
+ internal static void ThrowArgumentExceptionForHasSizeGreaterThan(Memory memory, int size, string name)
{
ThrowArgumentException(name, $"Parameter {name.ToAssertString()} ({typeof(Memory).ToTypeString()}) must have a size over {size}, had a size of {memory.Length.ToAssertString()}");
}
@@ -285,7 +285,7 @@ public static void ThrowArgumentExceptionForHasSizeGreaterThan(Memory memo
///
[MethodImpl(MethodImplOptions.NoInlining)]
[DoesNotReturn]
- public static void ThrowArgumentExceptionForHasSizeGreaterThanOrEqualTo(Memory memory, int size, string name)
+ internal static void ThrowArgumentExceptionForHasSizeGreaterThanOrEqualTo(Memory memory, int size, string name)
{
ThrowArgumentException(name, $"Parameter {name.ToAssertString()} ({typeof(Memory).ToTypeString()}) must have a size of at least {size}, had a size of {memory.Length.ToAssertString()}");
}
@@ -295,7 +295,7 @@ public static void ThrowArgumentExceptionForHasSizeGreaterThanOrEqualTo(Memor
///
[MethodImpl(MethodImplOptions.NoInlining)]
[DoesNotReturn]
- public static void ThrowArgumentExceptionForHasSizeLessThan(Memory memory, int size, string name)
+ internal static void ThrowArgumentExceptionForHasSizeLessThan(Memory memory, int size, string name)
{
ThrowArgumentException(name, $"Parameter {name.ToAssertString()} ({typeof(Memory).ToTypeString()}) must have a size less than {size}, had a size of {memory.Length.ToAssertString()}");
}
@@ -305,7 +305,7 @@ public static void ThrowArgumentExceptionForHasSizeLessThan(Memory memory,
///
[MethodImpl(MethodImplOptions.NoInlining)]
[DoesNotReturn]
- public static void ThrowArgumentExceptionForHasSizeLessThanOrEqualTo(Memory memory, int size, string name)
+ internal static void ThrowArgumentExceptionForHasSizeLessThanOrEqualTo(Memory memory, int size, string name)
{
ThrowArgumentException(name, $"Parameter {name.ToAssertString()} ({typeof(Memory).ToTypeString()}) must have a size less than or equal to {size}, had a size of {memory.Length.ToAssertString()}");
}
@@ -315,7 +315,7 @@ public static void ThrowArgumentExceptionForHasSizeLessThanOrEqualTo(Memory
[MethodImpl(MethodImplOptions.NoInlining)]
[DoesNotReturn]
- public static void ThrowArgumentExceptionForHasSizeEqualTo(Memory source, Memory destination, string name)
+ internal static void ThrowArgumentExceptionForHasSizeEqualTo(Memory source, Memory destination, string name)
{
ThrowArgumentException(name, $"The source {name.ToAssertString()} ({typeof(Memory).ToTypeString()}) must have a size equal to {destination.Length.ToAssertString()} (the destination), had a size of {source.Length.ToAssertString()}");
}
@@ -325,7 +325,7 @@ public static void ThrowArgumentExceptionForHasSizeEqualTo(Memory source,
///
[MethodImpl(MethodImplOptions.NoInlining)]
[DoesNotReturn]
- public static void ThrowArgumentExceptionForHasSizeLessThanOrEqualTo(Memory source, Memory destination, string name)
+ internal static void ThrowArgumentExceptionForHasSizeLessThanOrEqualTo(Memory source, Memory destination, string name)
{
ThrowArgumentException(name, $"The source {name.ToAssertString()} ({typeof(Memory).ToTypeString()}) must have a size less than or equal to {destination.Length.ToAssertString()} (the destination), had a size of {source.Length.ToAssertString()}");
}
@@ -335,9 +335,9 @@ public static void ThrowArgumentExceptionForHasSizeLessThanOrEqualTo(Memory
[MethodImpl(MethodImplOptions.NoInlining)]
[DoesNotReturn]
- public static void ThrowArgumentOutOfRangeExceptionForIsInRangeFor(int index, Memory memory, string name)
+ internal static void ThrowArgumentOutOfRangeExceptionForIsInRangeFor(int index, Memory memory, string name)
{
- ThrowArgumentOutOfRangeException(name, $"Parameter {name.ToAssertString()} (int) must be in the range given by <0> and {memory.Length.ToAssertString()} to be a valid index for the target collection ({typeof(Memory).ToTypeString()}), was {index.ToAssertString()}");
+ ThrowArgumentOutOfRangeException(name, index, $"Parameter {name.ToAssertString()} (int) must be in the range given by <0> and {memory.Length.ToAssertString()} to be a valid index for the target collection ({typeof(Memory).ToTypeString()}), was {index.ToAssertString()}");
}
///
@@ -345,9 +345,9 @@ public static void ThrowArgumentOutOfRangeExceptionForIsInRangeFor(int index,
///
[MethodImpl(MethodImplOptions.NoInlining)]
[DoesNotReturn]
- public static void ThrowArgumentOutOfRangeExceptionForIsNotInRangeFor(int index, Memory memory, string name)
+ internal static void ThrowArgumentOutOfRangeExceptionForIsNotInRangeFor(int index, Memory memory, string name)
{
- ThrowArgumentOutOfRangeException(name, $"Parameter {name.ToAssertString()} (int) must not be in the range given by <0> and {memory.Length.ToAssertString()} to be an invalid index for the target collection ({typeof(Memory).ToTypeString()}), was {index.ToAssertString()}");
+ ThrowArgumentOutOfRangeException(name, index, $"Parameter {name.ToAssertString()} (int) must not be in the range given by <0> and {memory.Length.ToAssertString()} to be an invalid index for the target collection ({typeof(Memory).ToTypeString()}), was {index.ToAssertString()}");
}
///
@@ -355,7 +355,7 @@ public static void ThrowArgumentOutOfRangeExceptionForIsNotInRangeFor(int ind
///
[MethodImpl(MethodImplOptions.NoInlining)]
[DoesNotReturn]
- public static void ThrowArgumentExceptionForIsEmpty(ReadOnlyMemory memory, string name)
+ internal static void ThrowArgumentExceptionForIsEmpty(ReadOnlyMemory memory, string name)
{
ThrowArgumentException(name, $"Parameter {name.ToAssertString()} ({typeof(ReadOnlyMemory).ToTypeString()}) must be empty, had a size of {memory.Length.ToAssertString()}");
}
@@ -365,7 +365,7 @@ public static void ThrowArgumentExceptionForIsEmpty(ReadOnlyMemory memory,
///
[MethodImpl(MethodImplOptions.NoInlining)]
[DoesNotReturn]
- public static void ThrowArgumentExceptionForHasSizeEqualTo(ReadOnlyMemory memory, int size, string name)
+ internal static void ThrowArgumentExceptionForHasSizeEqualTo(ReadOnlyMemory memory, int size, string name)
{
ThrowArgumentException(name, $"Parameter {name.ToAssertString()} ({typeof(ReadOnlyMemory).ToTypeString()}) must have a size equal to {size}, had a size of {memory.Length.ToAssertString()}");
}
@@ -375,7 +375,7 @@ public static void ThrowArgumentExceptionForHasSizeEqualTo(ReadOnlyMemory
///
[MethodImpl(MethodImplOptions.NoInlining)]
[DoesNotReturn]
- public static void ThrowArgumentExceptionForHasSizeNotEqualTo(ReadOnlyMemory memory, int size, string name)
+ internal static void ThrowArgumentExceptionForHasSizeNotEqualTo(ReadOnlyMemory memory, int size, string name)
{
ThrowArgumentException(name, $"Parameter {name.ToAssertString()} ({typeof(ReadOnlyMemory).ToTypeString()}) must have a size not equal to {size}, had a size of {memory.Length.ToAssertString()}");
}
@@ -385,7 +385,7 @@ public static void ThrowArgumentExceptionForHasSizeNotEqualTo(ReadOnlyMemory<
///
[MethodImpl(MethodImplOptions.NoInlining)]
[DoesNotReturn]
- public static void ThrowArgumentExceptionForHasSizeGreaterThan(ReadOnlyMemory memory, int size, string name)
+ internal static void ThrowArgumentExceptionForHasSizeGreaterThan