ArgOutOfRangeException throw helpers (#78222)
authorhrrrrustic <hrrrrustic@gmail.com>
Thu, 1 Dec 2022 23:48:13 +0000 (02:48 +0300)
committerGitHub <noreply@github.com>
Thu, 1 Dec 2022 23:48:13 +0000 (18:48 -0500)
commitab35b89f037b0fa7cb68668ad2dfa93b6bc38462
tree850388be4a25aa7074e717eddee4fa531f11794b
parent64ee6b9429d8259558b750a60ba38b27d56c4420
ArgOutOfRangeException throw helpers (#78222)

* add implementation

* add docs

* Add some tests

* Some replacements in CoreLib root namespace

* Apply suggestions from code review

Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Inline negativeorzero

* fix messages

* fix throwing

* fix paramnames

* fix nullability

* one more paramname fix

* make private throwers generic

* Apply suggestions from code review

Co-authored-by: Dan Moseley <danmose@microsoft.com>
* apply review comments

* few more cleanups

* Address my own PR feedback and use helpers in more places

Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Dan Moseley <danmose@microsoft.com>
22 files changed:
src/coreclr/System.Private.CoreLib/src/System/GC.CoreCLR.cs
src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/MethodBuilder.cs
src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.CoreCLR.cs
src/libraries/System.Private.CoreLib/src/Resources/Strings.resx
src/libraries/System.Private.CoreLib/src/System/ArgumentOutOfRangeException.cs
src/libraries/System.Private.CoreLib/src/System/BitConverter.cs
src/libraries/System.Private.CoreLib/src/System/Buffer.cs
src/libraries/System.Private.CoreLib/src/System/Buffers/ConfigurableArrayPool.cs
src/libraries/System.Private.CoreLib/src/System/Buffers/TlsOverPerCoreLockedStacksArrayPool.cs
src/libraries/System.Private.CoreLib/src/System/Convert.cs
src/libraries/System.Private.CoreLib/src/System/Decimal.cs
src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventPipe.cs
src/libraries/System.Private.CoreLib/src/System/Numerics/Matrix4x4.cs
src/libraries/System.Private.CoreLib/src/System/String.Comparison.cs
src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs
src/libraries/System.Private.CoreLib/src/System/String.cs
src/libraries/System.Private.CoreLib/src/System/Text/Encoding.cs
src/libraries/System.Private.CoreLib/src/System/Threading/ManualResetEventSlim.cs
src/libraries/System.Private.CoreLib/src/System/Threading/ReaderWriterLockSlim.cs
src/libraries/System.Private.CoreLib/src/System/Version.cs
src/libraries/System.Runtime/ref/System.Runtime.cs
src/libraries/System.Runtime/tests/System/ArgumentOutOfRangeExceptionTests.cs