Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
1776 Inherit Generic Virtual Method Bug: Fix
Previously an exception was thrown during class creation if the python class inherited from a class with a virtual generic method.

This has been fixed by ignoring generic methods when creating overloads in the generated class. Note, this means that generic virtual methods cannot be overridden in python code.
  • Loading branch information
rmadsen-ks committed Oct 31, 2022
commit bfcf1d1b66f7d8d2d63989d506460713c91f8bf5
5 changes: 3 additions & 2 deletions src/runtime/Types/ClassDerived.cs
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,9 @@ internal static Type CreateDerivedType(string name,
var virtualMethods = new HashSet<string>();
foreach (MethodInfo method in methods)
{
if (!method.Attributes.HasFlag(MethodAttributes.Virtual) |
method.Attributes.HasFlag(MethodAttributes.Final))
if (!method.Attributes.HasFlag(MethodAttributes.Virtual)
|| method.Attributes.HasFlag(MethodAttributes.Final)
|| method.IsGenericMethod)
{
continue;
}
Expand Down