2005-10-17 Marek Safar <marek.safar@seznam.cz>
[mono.git] / mcs / mcs / pending.cs
index ba21e60c8592f457f1f7b55be46bf3ac917ce6bb..cd189eaaa889a6122da1cf197ef664553a760d5c 100644 (file)
@@ -430,7 +430,10 @@ namespace Mono.CSharp {
 
                                        for (j = 0; j < top; j++)
                                                if (tm.args [i][j] != args.ParameterType (j) ||
-                                                   tm.mods [i][j] != args.ParameterModifier (j))
+                                                               (tm.mods [i][j] != args.ParameterModifier (j) &&
+                                                                tm.mods [i][j] != Parameter.Modifier.PARAMS &&
+                                                                args.ParameterModifier (j) != Parameter.Modifier.PARAMS)
+                                                        )
                                                        break;
                                        if (j != top)
                                                continue;
@@ -522,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;
                }
 
@@ -558,7 +571,7 @@ namespace Mono.CSharp {
 
                                                if (BaseImplements (type, mi))
                                                        continue;
-
+                                               
                                                if (pending_implementations [i].optional)
                                                        continue;
 
@@ -566,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++;