Author: atsushi
Date: 2005-04-13 04:06:20 -0400 (Wed, 13 Apr 2005)
New Revision: 42892
Modified:
trunk/mcs/mcs/ChangeLog
trunk/mcs/mcs/doc.cs
Log:
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.
Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog 2005-04-13 07:05:58 UTC (rev 42891)
+++ trunk/mcs/mcs/ChangeLog 2005-04-13 08:06:20 UTC (rev 42892)
@@ -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/mcs/doc.cs
===================================================================
--- trunk/mcs/mcs/doc.cs 2005-04-13 07:05:58 UTC (rev 42891)
+++ trunk/mcs/mcs/doc.cs 2005-04-13 08:06:20 UTC (rev 42892)
@@ -330,6 +330,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),
emptyParamList,
@@ -351,8 +352,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.
@@ -361,7 +365,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
@@ -585,7 +593,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);
@@ -596,7 +606,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);
@@ -609,6 +621,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