Author: marek
Date: 2007-02-24 10:44:21 -0500 (Sat, 24 Feb 2007)
New Revision: 73391

Modified:
   trunk/mcs/mcs/ChangeLog
   trunk/mcs/mcs/ecore.cs
Log:
2007-02-24  Marek Safar  <[EMAIL PROTECTED]>

        A fix for bug #80407
        * ecore.cs: Don't report ambiguity error when methods have same parent.


Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog     2007-02-24 15:01:38 UTC (rev 73390)
+++ trunk/mcs/mcs/ChangeLog     2007-02-24 15:44:21 UTC (rev 73391)
@@ -1,3 +1,8 @@
+2007-02-24  Marek Safar  <[EMAIL PROTECTED]>
+
+       A fix for bug #80407
+       * ecore.cs: Don't report ambiguity error when methods have same parent.
+
 2007-02-23  Marek Safar  <[EMAIL PROTECTED]>
 
        A fix for bug #80878

Modified: trunk/mcs/mcs/ecore.cs
===================================================================
--- trunk/mcs/mcs/ecore.cs      2007-02-24 15:01:38 UTC (rev 73390)
+++ trunk/mcs/mcs/ecore.cs      2007-02-24 15:44:21 UTC (rev 73391)
@@ -628,8 +628,8 @@
 
                        if (mi.Length > 1) {
                                bool is_interface = qualifier_type != null && 
qualifier_type.IsInterface;
-                               MemberInfo non_method = null;
                                ArrayList methods = new ArrayList (2);
+                               ArrayList non_methods = null;
 
                                foreach (MemberInfo m in mi) {
                                        if (m is MethodBase) {
@@ -637,24 +637,29 @@
                                                continue;
                                        }
 
-                                       if (non_method == null) {
-                                               non_method = m;
+                                       if (non_methods == null) {
+                                               non_methods = new ArrayList (2);
+                                               non_methods.Add (m);
                                                continue;
                                        }
 
-                                       Report.SymbolRelatedToPreviousError (m);
-                                       Report.SymbolRelatedToPreviousError 
(non_method);
-                                       Report.Error (229, loc, "Ambiguity 
between `{0}' and `{1}'",
-                                               
TypeManager.GetFullNameSignature (m), TypeManager.GetFullNameSignature 
(non_method));
-                                       return null;
+                                       foreach (MemberInfo n_m in non_methods) 
{
+                                               if (m.DeclaringType.IsInterface 
&& TypeManager.ImplementsInterface (m.DeclaringType, n_m.DeclaringType))
+                                                       continue;
+
+                                               
Report.SymbolRelatedToPreviousError (m);
+                                               Report.Error (229, loc, 
"Ambiguity between `{0}' and `{1}'",
+                                                       
TypeManager.GetFullNameSignature (m), TypeManager.GetFullNameSignature (n_m));
+                                               return null;
+                                       }
                                }
 
                                if (methods.Count == 0)
-                                       return null;
+                                       return ExprClassFromMemberInfo 
(container_type, (MemberInfo)non_methods [0], loc);
 
-                               if (non_method != null) {
+                               if (non_methods != null) {
                                        MethodBase method = (MethodBase) 
methods [0];
-
+                                       MemberInfo non_method = (MemberInfo) 
non_methods [0];
                                        if (method.DeclaringType == 
non_method.DeclaringType) {
                                                // Cannot happen with C# code, 
but is valid in IL
                                                
Report.SymbolRelatedToPreviousError (method);

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to