diff --git a/src/embed_tests/Events.cs b/src/embed_tests/Events.cs index cc51176dc..d2f43ea50 100644 --- a/src/embed_tests/Events.cs +++ b/src/embed_tests/Events.cs @@ -48,6 +48,12 @@ public ClassWithEventHandler() this.arr = new int[800]; } + // Reference LeakEvent to silence warning + protected virtual void OnLeakEvent(EventArgs e) + { + LeakEvent?.Invoke(this, e); + } + ~ClassWithEventHandler() { Interlocked.Decrement(ref alive); diff --git a/src/runtime/PythonTypes/PyFloat.cs b/src/runtime/PythonTypes/PyFloat.cs index 50621d5c2..379228f29 100644 --- a/src/runtime/PythonTypes/PyFloat.cs +++ b/src/runtime/PythonTypes/PyFloat.cs @@ -103,5 +103,7 @@ public static PyFloat AsFloat(PyObject value) public double ToDouble() => Runtime.PyFloat_AsDouble(obj); public override TypeCode GetTypeCode() => TypeCode.Double; + + public override int GetHashCode() => base.GetHashCode(); } } diff --git a/src/runtime/PythonTypes/PyInt.cs b/src/runtime/PythonTypes/PyInt.cs index 0d00f5a13..7ab7f9ec1 100644 --- a/src/runtime/PythonTypes/PyInt.cs +++ b/src/runtime/PythonTypes/PyInt.cs @@ -232,5 +232,7 @@ public string ToString(string format, IFormatProvider formatProvider) } public override TypeCode GetTypeCode() => TypeCode.Int64; + + public override int GetHashCode() => base.GetHashCode(); } } diff --git a/src/runtime/Util/ReflectionPolyfills.cs b/src/runtime/Util/ReflectionPolyfills.cs index b33698509..4bdf687c8 100644 --- a/src/runtime/Util/ReflectionPolyfills.cs +++ b/src/runtime/Util/ReflectionPolyfills.cs @@ -14,7 +14,7 @@ public static AssemblyBuilder DefineDynamicAssembly(this AppDomain _, AssemblyNa public static Type CreateType(this TypeBuilder typeBuilder) { - return typeBuilder.CreateTypeInfo(); + return typeBuilder.CreateTypeInfo()!; } public static T GetCustomAttribute(this Type type) where T: Attribute