[Ikvm-commit] ikvm/runtime DynamicTypeWrapper.cs,1.254,1.255
Brought to you by:
jfrijters
|
From: Jeroen F. <jfr...@us...> - 2014-11-11 15:03:21
|
Update of /cvsroot/ikvm/ikvm/runtime In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv12423 Modified Files: DynamicTypeWrapper.cs Log Message: Bug fix. Miranda method in base class should not interfere with default interface methods. Index: DynamicTypeWrapper.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/runtime/DynamicTypeWrapper.cs,v retrieving revision 1.254 retrieving revision 1.255 diff -C2 -d -r1.254 -r1.255 *** DynamicTypeWrapper.cs 8 Jul 2014 08:23:41 -0000 1.254 --- DynamicTypeWrapper.cs 11 Nov 2014 15:03:18 -0000 1.255 *************** *** 1273,1277 **** { MethodWrapper mw = GetMethodWrapperDuringCtor(lookup, methods, ifmethod.Name, ifmethod.Signature); ! if (mw == null) { mw = MirandaMethodWrapper.Create(wrapper, ifmethod); --- 1273,1277 ---- { MethodWrapper mw = GetMethodWrapperDuringCtor(lookup, methods, ifmethod.Name, ifmethod.Signature); ! if (mw == null || (mw.IsMirandaMethod && mw.DeclaringType != wrapper)) { mw = MirandaMethodWrapper.Create(wrapper, ifmethod); *************** *** 2909,2913 **** Debug.Assert(baseMethods[index].Length == 1 && baseMethods[index][0].DeclaringType.IsInterface); MirandaMethodWrapper mmw = (MirandaMethodWrapper)methods[index]; ! MethodAttributes attr = MethodAttributes.HideBySig | MethodAttributes.NewSlot | MethodAttributes.Public | MethodAttributes.Virtual | MethodAttributes.CheckAccessOnOverride; if (wrapper.IsInterface || (wrapper.IsAbstract && mmw.BaseMethod.IsAbstract && mmw.Error == null)) { --- 2909,2919 ---- Debug.Assert(baseMethods[index].Length == 1 && baseMethods[index][0].DeclaringType.IsInterface); MirandaMethodWrapper mmw = (MirandaMethodWrapper)methods[index]; ! MethodAttributes attr = MethodAttributes.HideBySig | MethodAttributes.Public | MethodAttributes.Virtual | MethodAttributes.CheckAccessOnOverride; ! MethodWrapper baseMiranda; ! if (wrapper.BaseTypeWrapper == null || (baseMiranda = wrapper.BaseTypeWrapper.GetMethodWrapper(mw.Name, mw.Signature, true)) == null || !baseMiranda.IsMirandaMethod) ! { ! // we're not overriding a miranda method in a base class, so can we set the newslot flag ! attr |= MethodAttributes.NewSlot; ! } if (wrapper.IsInterface || (wrapper.IsAbstract && mmw.BaseMethod.IsAbstract && mmw.Error == null)) { |