From ed8fef45163be84f3df9f7ccc88c0ebf1a049cbd Mon Sep 17 00:00:00 2001 From: jfrijters Date: Tue, 6 Sep 2011 07:37:30 +0000 Subject: [PATCH] Bug fix. Don't create a miranda method if the class already has a static method with the same signature. --- runtime/DynamicTypeWrapper.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/DynamicTypeWrapper.cs b/runtime/DynamicTypeWrapper.cs index 1f30c600..e583fe5e 100644 --- a/runtime/DynamicTypeWrapper.cs +++ b/runtime/DynamicTypeWrapper.cs @@ -1167,7 +1167,7 @@ namespace IKVM.Internal baseMethods.Add(ifmethod); break; } - if (!mw.IsStatic) + if (!mw.IsStatic || mw.DeclaringType == wrapper) { break; } @@ -4460,7 +4460,7 @@ namespace IKVM.Internal } else { - if (!wrapper.IsAbstract) + if (!wrapper.IsAbstract || (!baseClassInterface && wrapper.GetMethodWrapper(ifmethod.Name, ifmethod.Signature, false) != null)) { // the type doesn't implement the interface method and isn't abstract either. The JVM allows this, but the CLR doesn't, // so we have to create a stub method that throws an AbstractMethodError