static void TestConstrainedMethodCallsOnEnum() { // Enum.GetHashCode optimization requires special treatment // in native signature encoding MyEnum e = MyEnum.Apple; e.GetHashCode(); }
public override int ExpectedFromCodegen() { unchecked { var hashCode = 0; hashCode = (hashCode * 397) ^ Enum1.GetHashCode(); hashCode = (hashCode * 397) ^ Enum2.GetHashCode(); return(hashCode); } }
public override int GetHashCode() { unchecked { int result = Enum.GetHashCode(); result = (result * 397) ^ (Class != null ? Class.GetHashCode() : 0); result = (result * 397) ^ Integer32; result = (result * 397) ^ (String != null ? String.GetHashCode() : 0); return(result); } }
static void TestConstrainedMethodCalls() { using (MyStruct s = new MyStruct()) { ((Object)s).ToString(); } // Enum.GetHashCode optimization requires special treatment // in native signature encoding MyEnum e = MyEnum.Apple; e.GetHashCode(); }