[mcs] Reset doc reader state after expression bodied property. Fixes #32456
authorMarek Safar <marek.safar@gmail.com>
Mon, 27 Jul 2015 12:10:13 +0000 (14:10 +0200)
committerMarek Safar <marek.safar@gmail.com>
Mon, 27 Jul 2015 12:11:33 +0000 (14:11 +0200)
mcs/mcs/cs-parser.jay
mcs/tests/test-xml-072-ref.xml [new file with mode: 0644]
mcs/tests/test-xml-072.cs [new file with mode: 0644]

index d3d6671a8404480c891eff1898f50cf335f2745e..6864b1150da3754d0aa97fb88c9fdfcf172fe0d3 100644 (file)
@@ -1858,6 +1858,9 @@ property_declaration
                if (type.Type != null && type.Type.Kind == MemberKind.Void)
                        report.Error (547, GetLocation ($3), "`{0}': property or indexer cannot have void type", property.GetSignatureForError ());
 
+               if (doc_support)
+                       property.DocComment = ConsumeStoredComment ();
+
                current_type.AddMember (property);
 
                current_local_parameters = null;
diff --git a/mcs/tests/test-xml-072-ref.xml b/mcs/tests/test-xml-072-ref.xml
new file mode 100644 (file)
index 0000000..85b8879
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<doc>
+    <assembly>
+        <name>test-xml-072</name>
+    </assembly>
+    <members>
+        <member name="T:X.C">
+            <summary>
+            Top-class
+            </summary></member>
+        <member name="M:X.C.Main">
+            <summary>
+            foo
+            </summary></member>
+    </members>
+</doc>
diff --git a/mcs/tests/test-xml-072.cs b/mcs/tests/test-xml-072.cs
new file mode 100644 (file)
index 0000000..a160b23
--- /dev/null
@@ -0,0 +1,17 @@
+// Compiler options: -doc:xml-072.xml
+
+class X
+{
+       /// <summary>
+       /// Top-class
+       /// </summary>
+       public sealed class C
+       {
+               public string Severity => "foo";
+
+               /// <summary>
+               /// foo
+               /// </summary>
+               public static void Main() {}
+       }
+}
\ No newline at end of file