Skip to content

Commit 8364176

Browse files
committed
Silence compile-time warnings
1 parent dc69411 commit 8364176

4 files changed

Lines changed: 8 additions & 1 deletion

File tree

src/embed_tests/Events.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ public class ClassWithEventHandler
4444

4545
public ClassWithEventHandler()
4646
{
47+
// Reference LeakEvent to silence warning
48+
var _ = LeakEvent.GetType();
49+
4750
Interlocked.Increment(ref alive);
4851
this.arr = new int[800];
4952
}

src/runtime/PythonTypes/PyFloat.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,5 +103,7 @@ public static PyFloat AsFloat(PyObject value)
103103
public double ToDouble() => Runtime.PyFloat_AsDouble(obj);
104104

105105
public override TypeCode GetTypeCode() => TypeCode.Double;
106+
107+
public override int GetHashCode() => base.GetHashCode();
106108
}
107109
}

src/runtime/PythonTypes/PyInt.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,5 +232,7 @@ public string ToString(string format, IFormatProvider formatProvider)
232232
}
233233

234234
public override TypeCode GetTypeCode() => TypeCode.Int64;
235+
236+
public override int GetHashCode() => base.GetHashCode();
235237
}
236238
}

src/runtime/Util/ReflectionPolyfills.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public static AssemblyBuilder DefineDynamicAssembly(this AppDomain _, AssemblyNa
1414

1515
public static Type CreateType(this TypeBuilder typeBuilder)
1616
{
17-
return typeBuilder.CreateTypeInfo();
17+
return typeBuilder.CreateTypeInfo()!;
1818
}
1919

2020
public static T GetCustomAttribute<T>(this Type type) where T: Attribute

0 commit comments

Comments
 (0)