FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Silence compile-time warnings by filmor · Pull Request #2725 · pythonnet/pythonnet · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .cs  (4) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
6 changes: 6 additions & 0 deletions src/embed_tests/Events.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions src/runtime/PythonTypes/PyFloat.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
2 changes: 2 additions & 0 deletions src/runtime/PythonTypes/PyInt.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -232,5 +232,7 @@ public string ToString(string format, IFormatProvider formatProvider)
}

public override TypeCode GetTypeCode() => TypeCode.Int64;

public override int GetHashCode() => base.GetHashCode();
}
}
2 changes: 1 addition & 1 deletion src/runtime/Util/ReflectionPolyfills.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -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<T>(this Type type) where T: Attribute
Expand Down
Loading

Back | FazBrowse Home | New Git URL