I just discovered a subtle bug where I had an enum with two names unintentially sharing the same numeric value (in this case red=10 and crimson=10). I'm a bit surprised this isn't a syntax error.
public enum Colour
{
Red=10,
Blue=11,
Green=12,
Crimson=10
}
// Debug.Write(Colour.Red==Colour.Crimson) outputs True
Is there any real world reason why this behaviour might be a useful or do think it should be a syntax error?