2005-10-17 Marek Safar <marek.safar@seznam.cz>
[mono.git] / mcs / mcs / pending.cs
index 133da0d7dad38b701689ac6b225d2c3d7a51b69f..cd189eaaa889a6122da1cf197ef664553a760d5c 100644 (file)
@@ -525,9 +525,19 @@ namespace Mono.CSharp {
                        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;
                }
 
@@ -561,7 +571,7 @@ namespace Mono.CSharp {
 
                                                if (BaseImplements (type, mi))
                                                        continue;
-
+                                               
                                                if (pending_implementations [i].optional)
                                                        continue;
 
@@ -569,24 +579,24 @@ namespace Mono.CSharp {
                                                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++;