2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
authorAtsushi Eno <atsushieno@gmail.com>
Wed, 16 Nov 2005 22:47:05 +0000 (22:47 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Wed, 16 Nov 2005 22:47:05 +0000 (22:47 -0000)
* doc.cs : apply "override filter" also to properties.
  Fixed bug #76730.

* test-xml-047-ref.xml test-xml-047.cs :
  Another override filtering test (works with gmcs).

* cs1574-7.cs : fixed code format ("Line") to make it working.
* cs0419-3.cs : new test for ambiguity resolution.
* known-issues-gmcs : actually cs1574-7.cs is kind of regression,
  thus no need to be added here.

svn path=/trunk/mcs/; revision=53150

mcs/errors/ChangeLog
mcs/errors/cs0419-3.cs [new file with mode: 0644]
mcs/errors/cs1574-7.cs
mcs/errors/known-issues-gmcs
mcs/mcs/ChangeLog
mcs/mcs/doc.cs
mcs/tests/ChangeLog
mcs/tests/test-xml-047-ref.xml [new file with mode: 0644]
mcs/tests/test-xml-047.cs [new file with mode: 0644]

index 571b11aefd662df5d119d950c8fe98e4e4108143..df61662368e19ac7699858dfe958822257d9c5be 100644 (file)
@@ -1,3 +1,10 @@
+2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * cs1574-7.cs : fixed code format ("Line") to make it working.
+       * cs0419-3.cs : new test for ambiguity resolution.
+       * known-issues-gmcs : actually cs1574-7.cs is kind of regression,
+         thus no need to be added here.
+
 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
 
        * cs1574-7.cs : new test to warn doc reference to interface members 
diff --git a/mcs/errors/cs0419-3.cs b/mcs/errors/cs0419-3.cs
new file mode 100644 (file)
index 0000000..6465c9c
--- /dev/null
@@ -0,0 +1,16 @@
+// cs0419-3.cs: Ambiguous reference in cref attribute `XmlDocument.Load'. Assuming `System.Xml.XmlDocument.Load(System.IO.Stream)' but other overloads including `System.Xml.XmlDocument.Load(string)' have also matched
+// Line: 10
+// Compiler options: -doc:dummy.xml -warnaserror -warn:4
+// 
+// NOTE: this error message is dependent on the order of members, so feel free to modify the message if is going not to match.
+
+using System.Xml;
+
+/// <summary>
+/// <see cref="XmlDocument.Load" />
+/// </summary>
+public class EntryPoint
+{
+       static void Main () {
+       }
+}
index 6e5ff788a2b65a59f8aeec3b5fb76559222c29d7..eba9dbbf1869350d4e2fadc8554691600d2a3fcb 100644 (file)
@@ -1,6 +1,6 @@
 // cs1574-7.cs: XML comment on `A' has cref attribute `ExecuteSilently' that could not be resolved
-// Compiler options: -doc:dummy.xml -warnaserror
 // Line: 11
+// Compiler options: -doc:dummy.xml -warnaserror
 /// <summary />
 public interface IExecutable {
        /// <summary />
index 9606d2c5fdce8060d9709aa4824fdd3111467a99..a191a5535feaec15e82cdbaea45d19d2f08c13e3 100644 (file)
@@ -40,7 +40,6 @@ cs1528.cs
 cs1540-2.cs # new in GMCS
 cs1540-3.cs NO ERROR # new in GMCS
 cs1540-5.cs NO ERROR # new in GMCS
-cs1574-7.cs
 cs1586.cs
 cs1641.cs
 cs1667-3.cs
index edbc1a0204d7c92115d5bd8b5a4e907ee469bf92..bdf3498238713403622fae85ed0064c1285acfba 100644 (file)
@@ -1,3 +1,8 @@
+2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * doc.cs : apply "override filter" also to properties.
+         Fixed bug #76730.
+
 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
 
        * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
index 39524039bdb7537ce0702132196b8c08aa577cf1..66c004c02dc068f7b4051695fb4899ba15827820 100644 (file)
@@ -349,13 +349,22 @@ namespace Mono.CSharp {
                                bindingFlags,
                                MethodSignature.method_signature_filter,
                                signature);
+                       if (ml == null)
+                               return empty_member_infos;
 
+                       return FilterOverridenMembersOut (type, (MemberInfo []) ml);
+               }
+
+               private static MemberInfo [] FilterOverridenMembersOut (
+                       Type type, MemberInfo [] ml)
+               {
+                       if (ml == null)
+                               return empty_member_infos;
                        if (type.IsInterface)
-                               return ml != null ? (MemberInfo []) ml :
-                                       empty_member_infos;
+                               return ml;
 
-                       ArrayList al = new ArrayList (ml.Count);
-                       for (int i = 0; i < ml.Count; i++) {
+                       ArrayList al = new ArrayList (ml.Length);
+                       for (int i = 0; i < ml.Length; i++) {
                                // Interface methods which are returned
                                // from the filter must exist in the 
                                // target type (if there is only a 
@@ -371,7 +380,7 @@ namespace Mono.CSharp {
                                MethodBase x = ml [i] as MethodBase;
                                if (x != null) {
                                        bool overriden = false;
-                                       for (int j = 0; j < ml.Count; j++) {
+                                       for (int j = 0; j < ml.Length; j++) {
                                                if (j == i)
                                                        continue;
                                                MethodBase y = ml [j] as MethodBase;
@@ -416,6 +425,7 @@ namespace Mono.CSharp {
                                        type, MemberTypes.All,
                                        BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance,
                                        memberName, null);
+                               mis = FilterOverridenMembersOut (type, mis);
                                if (mis == null || mis.Length == 0)
                                        return null;
                                if (warn419 && IsAmbiguous (mis))
index c2b05360ed0f97dbe478b8505834f33ec777c307..7d71f63d19386b498f27020bd0ab71d2e51b6694 100644 (file)
@@ -1,3 +1,8 @@
+2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * test-xml-047-ref.xml test-xml-047.cs :
+         Another override filtering test (works with gmcs).
+
 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
 
        * test-xml-046-ref.xml test-xml-046.cs : new test for bug #76726.
diff --git a/mcs/tests/test-xml-047-ref.xml b/mcs/tests/test-xml-047-ref.xml
new file mode 100644 (file)
index 0000000..91d5137
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<doc>
+    <assembly>
+        <name>test-xml-047</name>
+    </assembly>
+    <members>
+        <member name="T:EntryPoint">
+            <summary>
+            <see cref="M:System.Boolean.GetHashCode"/>
+            </summary>
+        </member>
+    </members>
+</doc>
diff --git a/mcs/tests/test-xml-047.cs b/mcs/tests/test-xml-047.cs
new file mode 100644 (file)
index 0000000..70febc2
--- /dev/null
@@ -0,0 +1,12 @@
+// Compiler options: -doc:dummy.xml -warnaserror -warn:4
+
+using System;
+
+/// <summary>
+/// <see cref="bool.GetHashCode" />
+/// </summary>
+public class EntryPoint
+{
+       static void Main () {
+       }
+}