diff --git a/C#-and-.NET-docs-supplement.md b/C#-and-.NET-docs-supplement.md index efdc07f..920c386 100644 --- a/C#-and-.NET-docs-supplement.md +++ b/C#-and-.NET-docs-supplement.md @@ -56,6 +56,10 @@ The table [here](https://learn.microsoft.com/en-us/dotnet/csharp/language-refere That is, you must use `#if !(NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER)` and not just `#if !NETSTANDARD2_1_OR_GREATER`. +## Signed/Unsigned byte array casting + +As Jon Skeet himself explains [here](https://stackoverflow.com/a/11039703), "Even though in C# you can't cast a `byte[]` to an `sbyte[]` directly, the CLR allows it". This leads to some weird behaviour, since the compiler is hardcoded to replace *only some* type checks with consts. + ## `String.GetHashCode` stability The `GetHashCode` implementation for strings does not reflect the string's contents, and as such, the hash not stable between program instances.