mi = TypeContainer.FindMembers (
current_type, MemberTypes.Method,
- BindingFlags.Public | BindingFlags.Instance |
- BindingFlags.DeclaredOnly,
+ BindingFlags.Public | BindingFlags.NonPublic |
+ BindingFlags.Instance | BindingFlags.DeclaredOnly,
virtual_method_filter, null);
if (current_type == TypeManager.object_type)
int j = 0;
foreach (MethodInfo m in mi){
- Type [] types = TypeManager.GetArgumentTypes (m);
+ Type [] types;
+
+ // If there is a previous error, just ignore
+ if (m == null)
+ types = TypeManager.NoTypes;
+ else
+ types = TypeManager.GetArgumentTypes (m);
pending_implementations [i].args [j] = types;
j++;
int top = args.Length;
ILGenerator ig = proxy.GetILGenerator ();
- ig.Emit (OpCodes.Ldarg_0);
- for (int i = 0; i < top; i++){
- switch (i){
- case 0:
- ig.Emit (OpCodes.Ldarg_1); break;
- case 1:
- ig.Emit (OpCodes.Ldarg_2); break;
- case 2:
- ig.Emit (OpCodes.Ldarg_3); break;
- default:
- ig.Emit (OpCodes.Ldarg, i - 1); break;
- }
- }
+ for (int i = 0; i <= top; i++)
+ ParameterReference.EmitLdArg (ig, i);
+
ig.Emit (OpCodes.Call, base_method);
ig.Emit (OpCodes.Ret);
if (pending_implementations [i].optional)
continue;
-
+
+ Report.SymbolRelatedToPreviousError (mi);
if (pending_implementations [i].found [j]) {
- string[] methodLabel = TypeManager.CSharpSignature (mi).Split ('.');
- Report.Error (536, container.Location,
- "'{0}' does not implement interface member '{1}'. '{2}.{3}' " +
- "is either static, not public, or has the wrong return type",
- container.Name, TypeManager.CSharpSignature (mi),
- container.Name, methodLabel[methodLabel.Length - 1]);
+ if (mi.IsSpecialName) {
+ string name = TypeManager.CSharpName (mi.DeclaringType) + '.' + mi.Name.Substring (4);
+ Report.Error (551, container.Location, "Explicit interface implementation '{0}.{1}' is missing accessor '{1}'",
+ container.Name, name);
+ } else {
+ string[] methodLabel = TypeManager.CSharpSignature (mi).Split ('.');
+ Report.Error (536, container.Location,
+ "'{0}' does not implement interface member '{1}'. '{2}.{3}' " +
+ "is either static, not public, or has the wrong return type",
+ container.Name, TypeManager.CSharpSignature (mi),
+ container.Name, methodLabel[methodLabel.Length - 1]);
+ }
}
- else {
+ else {
Report.Error (535, container.Location, "'{0}' does not implement interface member '{1}'",
container.Name, TypeManager.CSharpSignature (mi));
}