Author: martin
Date: 2005-04-19 13:51:35 -0400 (Tue, 19 Apr 2005)
New Revision: 43274

Modified:
   trunk/mcs/gmcs/ChangeLog
   trunk/mcs/gmcs/doc.cs
Log:
**** Merged r42892 from MCS ****


Modified: trunk/mcs/gmcs/ChangeLog
===================================================================
--- trunk/mcs/gmcs/ChangeLog    2005-04-19 17:51:12 UTC (rev 43273)
+++ trunk/mcs/gmcs/ChangeLog    2005-04-19 17:51:35 UTC (rev 43274)
@@ -1,5 +1,10 @@
 2005-04-13  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
+       * doc.cs : detect ambiguous reference to overloaded members.
+         Fixed bug #71603. MS 1.1 csc does not detect it.
+
+2005-04-13  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
        * doc.cs : delegates must not be referenced with parameters.
          Fixed bug #71605.
 

Modified: trunk/mcs/gmcs/doc.cs
===================================================================
--- trunk/mcs/gmcs/doc.cs       2005-04-19 17:51:12 UTC (rev 43273)
+++ trunk/mcs/gmcs/doc.cs       2005-04-19 17:51:35 UTC (rev 43274)
@@ -328,6 +328,7 @@
                        Type parent = FindDocumentedType (mc, 
identifier.Substring (0, index), ds, cref);
                        if (parent == null)
                                return null;
+                       // no need to detect warning 419 here
                        return FindDocumentedMember (mc, parent,
                                identifier.Substring (index + 1),
                                Type.EmptyTypes,
@@ -349,8 +350,11 @@
                                BindingFlags.Public | BindingFlags.NonPublic | 
BindingFlags.Static | BindingFlags.Instance,
                                MethodSignature.method_signature_filter,
                                msig);
-                       if (mis.Length > 0)
+                       if (mis.Length > 0) {
+                               if (mis.Length > 1)
+                                       warningType = 419;
                                return mis [0];
+                       }
 
                        if (paramList.Length == 0) {
                                // search for fields/events etc.
@@ -359,7 +363,11 @@
                                        BindingFlags.Public | 
BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance,
                                        Type.FilterName,
                                        memberName);
-                               return (mis.Length > 0) ? mis [0] : null;
+                               if (mis.Length == 0)
+                                       return null;
+                               if (mis.Length > 1)
+                                       warningType = 419;
+                               return mis [0];
                        }
 
                        // search for operators (whose parameters exactly
@@ -581,7 +589,9 @@
                                int warnResult;
                                if (type != null) {
                                        MemberInfo mi = FindDocumentedMember 
(mc, type, memberName, parameterTypes, ds, out warnResult, cref);
-                                       if (warnResult > 0)
+                                       if (warnResult == 419)
+                                               Report419 (mc, memberName);
+                                       else if (warnResult > 0)
                                                return;
                                        if (mi != null) {
                                                xref.SetAttribute ("cref", 
GetMemberDocHead (mi.MemberType) + type.FullName.Replace ("+", ".") + "." + 
memberName + parameters);
@@ -592,7 +602,9 @@
                        else {
                                int warnResult;
                                MemberInfo mi = FindDocumentedMember (mc, 
ds.TypeBuilder, name, parameterTypes, ds, out warnResult, cref);
-                               if (warnResult > 0)
+                               if (warnResult == 419)
+                                       Report419 (mc, name);
+                               else if (warnResult > 0)
                                        return;
                                if (mi != null) {
                                        xref.SetAttribute ("cref", 
GetMemberDocHead (mi.MemberType) + ds.TypeBuilder.FullName.Replace ("+", ".") + 
"." + name);
@@ -605,6 +617,11 @@
                        xref.SetAttribute ("cref", "!:" + name);
                }
 
+               static void Report419 (MemberCore mc, string memberName)
+               {
+                       Report.Warning (419, 3, mc.Location, "Ambiguous member 
specification in cref attribute: '{0}'. Check overloaded members and supply 
exact parameters.", memberName);
+               }
+
                //
                // Get a prefix from member type for XML documentation (used
                // to formalize cref target name).

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

Reply via email to