Suppose I've following Code:
Console.WriteLine("Value1: " + SomeEnum.Value1.ToString() + "\r\nValue2: " +
SomeOtherEnum.Value2.ToString());
Will Compiler Optimize this to:
Console.WriteLine("Value1: " + SomeEnum.Value1 + "\r\nValue2: " +
SomeOtherEnum.Value2);
I've checked it with IL Disassembler and there are calls to
IL_005a: callvirt instance string [mscorlib]System.Object::ToString()
I don't know if JIT optimizes this.