2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
authorAtsushi Eno <atsushieno@gmail.com>
Wed, 18 Jul 2007 10:12:34 +0000 (10:12 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Wed, 18 Jul 2007 10:12:34 +0000 (10:12 -0000)
* doc.cs : when T: or whatever x: is specified, it does not really
  check the doc comment's syntax correctness. Fixed bug #82006.

* gtest-xml-2.cs, gtest-xml-2-ref.xml : new /doc test for bug #82006.

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

mcs/mcs/ChangeLog
mcs/mcs/doc.cs
mcs/tests/ChangeLog
mcs/tests/gtest-xml-2-ref.xml [new file with mode: 0644]
mcs/tests/gtest-xml-2.cs [new file with mode: 0644]

index 9dbe21bf36678798e4483be4fcd952b26739f37b..3c11a86493246e49803ea8ec3032664c02c2fa0f 100644 (file)
@@ -1,3 +1,8 @@
+2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * doc.cs : when T: or whatever x: is specified, it does not really
+         check the doc comment's syntax correctness. Fixed bug #82006.
+
 2007-07-18  Marek Safar  <marek.safar@gmail.com>
 
        * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
index 720e3fa1d74602e88ae468b12e50efe780991e9a..3ba61bec8adcf21710f6d2e01eaad4715aa5a395 100644 (file)
@@ -635,13 +635,20 @@ namespace Mono.CSharp {
                        string name; // method invokation "(...)" are removed
                        string parameters; // method parameter list
 
-                       // strip 'T:' 'M:' 'F:' 'P:' 'E:' etc.
-                       // Here, MS ignores its member kind. No idea why.
+                       // When it found '?:' ('T:' 'M:' 'F:' 'P:' 'E:' etc.),
+                       // MS ignores not only its member kind, but also
+                       // the entire syntax correctness. Nor it also does
+                       // type fullname resolution i.e. "T:List(int)" is kept
+                       // as T:List(int), not
+                       // T:System.Collections.Generic.List&lt;System.Int32&gt;
                        if (cref.Length > 2 && cref [1] == ':')
-                               signature = cref.Substring (2).Trim (wsChars);
+                               return;
                        else
                                signature = cref;
 
+                       // Also note that without "T:" any generic type 
+                       // indication fails.
+
                        int parens_pos = signature.IndexOf ('(');
                        int brace_pos = parens_pos >= 0 ? -1 :
                                signature.IndexOf ('[');
index ba45d7a603e2e1d5a3595b8656208d7253c3acc4..170fa4d18079de5c2609df713daa09d3e6e38718 100644 (file)
@@ -1,3 +1,7 @@
+2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * gtest-xml-2.cs, gtest-xml-2-ref.xml : new /doc test for bug #82006.
+
 2007-05-22  Scott Peterson  <lunchtimemama@gmail.com>
        
        * gtest-autoproperty-01.cs: Test for instance automatic properties (C# 3.0)
diff --git a/mcs/tests/gtest-xml-2-ref.xml b/mcs/tests/gtest-xml-2-ref.xml
new file mode 100644 (file)
index 0000000..1bc9cf1
--- /dev/null
@@ -0,0 +1,29 @@
+<?xml version="1.0"?>\r
+<doc>\r
+    <assembly>\r
+        <name>gtest-xml-2</name>\r
+    </assembly>\r
+    <members>\r
+        <member name="T:Foo">\r
+            <see cref="M:System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke2 ( )"/>\r
+            <see cref="F:Foo.Bar"/>\r
+            <see cref="M:Foo.ListBase(System.String)"/>\r
+            <see cref="T:ListBase(string)"/>\r
+            <see cref="T:ListBase&lt;string)"/><!-- it somehow passes -->\r
+            <see cref="T:List!$%Base()"/><!-- it somehow passes -->\r
+            <see cref="T:$%!"/>\r
+            <see cref=".:Bar"/>\r
+            <see cref="T:List(int)"/>\r
+        </member>\r
+        <member name="F:Foo.Bar">\r
+            hogehoge\r
+        </member>\r
+        <member name="M:Foo.ListBase(System.String)">\r
+            fugafuga\r
+        </member>\r
+        <member name="T:ListBase`1">\r
+            <see cref="T:System.Nullable&lt;System.Int32&gt;" />\r
+            <see cref="T:System.Nullable(System.Int32)" />\r
+        </member>\r
+    </members>\r
+</doc>\r
diff --git a/mcs/tests/gtest-xml-2.cs b/mcs/tests/gtest-xml-2.cs
new file mode 100644 (file)
index 0000000..1dda578
--- /dev/null
@@ -0,0 +1,34 @@
+using System.Collections.Generic;
+
+// <see cref="int?" /> - this is invalid 1584/1658
+// <see cref="List" />
+/// <see cref="M:System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke2 ( )" />
+/// <see cref="Bar" />
+/// <see cref="ListBase(string)" />
+/// <see cref="T:ListBase(string)" />
+/// <see cref="T:ListBase&lt;string)" /><!-- it somehow passes -->
+/// <see cref="T:List!$%Base()" /><!-- it somehow passes -->
+/// <see cref="T:$%!" />
+/// <see cref=".:Bar" />
+/// <see cref="T:List(int)" />
+public class Foo
+{
+       static void Main ()
+       {
+       }
+
+       /// hogehoge
+       public string Bar;
+
+       /// fugafuga
+       public void ListBase (string s)
+       {
+       }
+}
+
+// <see cref="System.Nullable&lt;System.Int32&gt;" /> - cs1658/1574
+/// <see cref="T:System.Nullable&lt;System.Int32&gt;" />
+/// <see cref="T:System.Nullable(System.Int32)" />
+public class ListBase<T>
+{
+}