[mcs] Add additional doc reset after property initializers. Fixes #35087
authorMarek Safar <marek.safar@gmail.com>
Tue, 20 Oct 2015 16:38:22 +0000 (18:38 +0200)
committerMarek Safar <marek.safar@gmail.com>
Tue, 20 Oct 2015 16:39:25 +0000 (18:39 +0200)
mcs/mcs/cs-parser.jay
mcs/tests/test-xml-074-ref.xml [new file with mode: 0644]
mcs/tests/test-xml-074.cs [new file with mode: 0644]

index fb6a3e87873597f165ac3c175682518293449355..b0c771f7207b2eb26aa12a288bd58e11f811aae3 100644 (file)
@@ -1829,9 +1829,9 @@ property_declaration
          accessor_declarations 
          {
                lexer.PropertyParsing = false;
-               
+
                if (doc_support)
-                       current_property.DocComment = ConsumeStoredComment ();                          
+                       current_property.DocComment = ConsumeStoredComment ();
          }
          CLOSE_BRACE
          {
@@ -1893,6 +1893,9 @@ opt_property_initializer
                lbag.AppendToMember (current_property, GetLocation ($1), GetLocation ($4));
                end_block (GetLocation ($4));
                current_local_parameters = null;
+
+               if (doc_support)
+                       Lexer.doc_state = XmlCommentState.Allowed;
          }
        ;
 
diff --git a/mcs/tests/test-xml-074-ref.xml b/mcs/tests/test-xml-074-ref.xml
new file mode 100644 (file)
index 0000000..d6cda5a
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<doc>
+    <assembly>
+        <name>test-xml-074</name>
+    </assembly>
+    <members>
+        <member name="T:Test">
+             <summary>The Test</summary>
+            </member>
+        <member name="P:Test.Foo">
+             <summary>The Foo</summary>
+            </member>
+        <member name="F:Test.TestFoo">
+             <summary>Tests the Foo</summary>
+            </member>
+    </members>
+</doc>
diff --git a/mcs/tests/test-xml-074.cs b/mcs/tests/test-xml-074.cs
new file mode 100644 (file)
index 0000000..5fec20e
--- /dev/null
@@ -0,0 +1,16 @@
+// Compiler options: -warnaserror -doc:xml-074.xml
+using System.Collections.Generic;
+
+ /// <summary>The Test</summary>
+ public class Test
+ {
+       /// <summary>The Foo</summary>
+       protected Dictionary<string, object> Foo { get; set; } = new Dictionary<string, object>();
+
+       /// <summary>Tests the Foo</summary>
+       protected bool TestFoo;
+
+       static void Main ()
+       {
+       }
+ }