Why is the enumeration value from a multi dimensional array not equal to itself?
Consider: using System; public class Test { enum State : sbyte { OK = 0, BUG = -1 } static void Main(string[] args) { var s = new State[1, 1]; s[0, 0] = State.BUG; State a = s[0, 0]; Console.WriteLine(a == s[0, 0]); // False } } How can this be explained? It occurs in debug builds in Visual Studio 2015 when running in the x86 JIT. A release build or running in the x64 JIT prints True as expected. To reproduce from the command line: csc Test.cs /platform:x86 /debug ( /debug:pdbonly , /debug:portable and /debug:full also reproduce.) You found a code generation bug in the .NET 4 x86 jitter. It is