if (list.Count == 0)
return false;
+ if (TypeManager.ImplementsInterface (container.TypeBuilder.BaseType, iface_type))
+ return true;
+
+ //
+ // FIXME: We should be creating fewer proxies. The runtime can handle most cases.
+ // At worst, if we can't avoid creating the proxy, we may need to make the
+ // proxy use Callvirt.
+ //
MethodInfo base_method = (MethodInfo) list [0];
- if (!base_method.IsAbstract)
+
+ if (!base_method.IsAbstract && !base_method.IsVirtual)
DefineProxy (iface_type, base_method, mi, args);
+
return true;
}
if (BaseImplements (type, mi))
continue;
-
+
if (pending_implementations [i].optional)
continue;
if (pending_implementations [i].found [j]) {
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);
+ Report.Error (551, container.Location, "Explicit interface implementation `{0}.{1}' is missing accessor `{2}'",
+ container.GetSignatureForError (), name, TypeManager.CSharpSignature (mi, true));
} else {
string[] methodLabel = TypeManager.CSharpSignature (mi).Split ('.');
Report.Error (536, container.Location,
- "'{0}' does not implement interface member '{1}'. '{2}.{3}' " +
+ "`{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 {
- Report.Error (535, container.Location, "'{0}' does not implement interface member '{1}'",
- container.Name, TypeManager.CSharpSignature (mi));
+ Report.Error (535, container.Location, "`{0}' does not implement interface member `{1}'",
+ container.GetSignatureForError (), TypeManager.CSharpSignature (mi));
}
} else {
- Report.Error (534, container.Location, "'{0}' does not implement inherited abstract member '{1}'",
- container.Name, TypeManager.CSharpSignature (mi));
+ Report.Error (534, container.Location, "`{0}' does not implement inherited abstract member `{1}'",
+ container.GetSignatureForError (), TypeManager.CSharpSignature (mi, true));
}
errors = true;
j++;