Skip to content

Commit

Permalink
do not include assembly-internal methods
Browse files Browse the repository at this point in the history
  • Loading branch information
eirannejad committed Apr 2, 2024
1 parent 66a404d commit a1e85e3
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/runtime/Types/ClassDerived.cs
Original file line number Diff line number Diff line change
Expand Up @@ -284,15 +284,16 @@ internal static Type CreateDerivedType(string typeName,
((m.Name.StartsWith("get_") || m.Name.StartsWith("set_"))
&& pyProperties.Contains(m.Name.Substring(4)));

return !alreadyOverriden
return m.Attributes.HasFlag(MethodAttributes.Virtual)
&& !alreadyOverriden
&& !m.IsPrivate
&& !m.IsAssembly
&& m.Attributes.HasFlag(MethodAttributes.Virtual)
&& !m.Attributes.HasFlag(MethodAttributes.Final)
// overriding generic virtual methods is not supported
// so a call to that should be deferred to the base class method.
&& !m.IsGenericMethod
&& !(IsMethod<OriginalMethod>(m) || IsMethod<RedirectedMethod>(m));
// overriding generic virtual methods is not supported
// so a call to that should be deferred to the base class method.
&& !m.IsGenericMethod
&& !m.Attributes.HasFlag(MethodAttributes.Final)
&& !m.Attributes.HasFlag(MethodAttributes.FamANDAssem)
&& !(IsMethod<OriginalMethod>(m) || IsMethod<RedirectedMethod>(m));
})
.Concat(baseInterfaces.SelectMany(x => x.GetMethods()))
.ToList();
Expand Down

0 comments on commit a1e85e3

Please sign in to comment.