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;
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;
}
}