In C#/.NET why is sbyte[] the same as byte[] except that it's not?
<p>I just observed a weird phenomenon in C#/.NET.</p>

<p>I created this minimal example to demonstrate:</p>

<pre><code>if (new sbyte[5] is byte[])
{
 throw new ApplicationException("Impossible!");
}

object o = new sbyte[5];

if (o is byte[])
{
 throw new ApplicationException("Why???");
}
</code></pre>

<p>This will throw "Why???", but not "Impossible!". It works for all arrays of integral types of the same size. Can someone explain this to me? I'm confused. I'm using .NET 4 by the way.</p>

<p>P.S.: I know that I can get the expected result by using <code>o.GetType() == typeof(byte[])</code>.</p>
