X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fmcs%2Fmembercache.cs;h=6e3c3ca986dbf331811ea1defa219f8e9cf86d8b;hb=cee551a2f4eb5295434a2ab65739c47f99f2ec68;hp=febafb59c29259b7473226e094647ada5dcbbb16;hpb=20f394737ad05ca81eb9806c76847bdd625e26b0;p=mono.git diff --git a/mcs/mcs/membercache.cs b/mcs/mcs/membercache.cs index febafb59c29..6e3c3ca986d 100644 --- a/mcs/mcs/membercache.cs +++ b/mcs/mcs/membercache.cs @@ -617,12 +617,6 @@ namespace Mono.CSharp { if ((entry.Modifiers & Modifiers.PRIVATE) != 0) continue; - // - // Skip override members with accessors they may not fully implement the base member - // - if (member_with_accessors && (entry.Modifiers & (Modifiers.OVERRIDE | Modifiers.SEALED)) == Modifiers.OVERRIDE) - continue; - if ((entry.Modifiers & Modifiers.AccessibilityMask) == Modifiers.INTERNAL) { if (!TypeManager.IsThisOrFriendAssembly (member.Assembly, entry.Assembly)) continue; @@ -640,27 +634,46 @@ namespace Mono.CSharp { continue; } - if (member_param == null) - return entry; + if (entry.Kind != mkind) { + if (bestCandidate == null) + bestCandidate = entry; - // Check arity match - int arity = member.MemberName.Arity; - if (arity != entry.Arity) continue; + } + + if (member_param != null) { + // Check arity match + int arity = member.MemberName.Arity; + if (arity != entry.Arity) + continue; + + var pm = entry as IParametersMember; + if (pm == null) + continue; - if (entry is IParametersMember) { if (entry.IsAccessor != member is AbstractPropertyEventMethod) continue; - var entry_param = ((IParametersMember) entry).Parameters; - if (TypeSpecComparer.Override.IsEqual (entry_param, member_param)) - return entry; + if (!TypeSpecComparer.Override.IsEqual (pm.Parameters, member_param)) + continue; + } - continue; + // + // Skip override members with accessors they may not fully implement the base member + // + if (member_with_accessors) { + if ((entry.Modifiers & (Modifiers.OVERRIDE | Modifiers.SEALED)) == Modifiers.OVERRIDE) { + // + // Set candidate to member override to flag we found an implementation + // + bestCandidate = entry; + continue; + } + } else { + bestCandidate = null; } - if (bestCandidate == null) - bestCandidate = entry; + return entry; } }