Bug fix. When enumerating virtual methods, we should only skip match actual base methods, not any method with the same signature.

This commit is contained in:
jfrijters 2012-08-09 21:20:57 +00:00
Родитель d15c9e3590
Коммит 79e5757ad4
1 изменённых файлов: 1 добавлений и 13 удалений

Просмотреть файл

@ -801,7 +801,7 @@ namespace IKVM.Reflection
{
baseMethods = new List<MethodInfo>();
}
else if (FindMethod(baseMethods, mi.GetBaseDefinition()))
else if (baseMethods.Contains(mi.GetBaseDefinition()))
{
continue;
}
@ -815,18 +815,6 @@ namespace IKVM.Reflection
return list.ToArray();
}
private static bool FindMethod(List<MethodInfo> methods, MethodInfo method)
{
foreach (MethodInfo m in methods)
{
if (m.Name == method.Name && m.MethodSignature.Equals(method.MethodSignature))
{
return true;
}
}
return false;
}
public MethodInfo[] GetMethods()
{
return GetMethods(BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance);