From 833137618276d3c5f190df2736485da09aa846d0 Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Mon, 27 Jul 2015 14:10:13 +0200 Subject: [PATCH] [mcs] Reset doc reader state after expression bodied property. Fixes #32456 --- mcs/mcs/cs-parser.jay | 3 +++ mcs/tests/test-xml-072-ref.xml | 16 ++++++++++++++++ mcs/tests/test-xml-072.cs | 17 +++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 mcs/tests/test-xml-072-ref.xml create mode 100644 mcs/tests/test-xml-072.cs diff --git a/mcs/mcs/cs-parser.jay b/mcs/mcs/cs-parser.jay index d3d6671a840..6864b1150da 100644 --- a/mcs/mcs/cs-parser.jay +++ b/mcs/mcs/cs-parser.jay @@ -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 index 00000000000..85b8879bb93 --- /dev/null +++ b/mcs/tests/test-xml-072-ref.xml @@ -0,0 +1,16 @@ + + + + test-xml-072 + + + + + Top-class + + + + foo + + + diff --git a/mcs/tests/test-xml-072.cs b/mcs/tests/test-xml-072.cs new file mode 100644 index 00000000000..a160b23838f --- /dev/null +++ b/mcs/tests/test-xml-072.cs @@ -0,0 +1,17 @@ +// Compiler options: -doc:xml-072.xml + +class X +{ + /// + /// Top-class + /// + public sealed class C + { + public string Severity => "foo"; + + /// + /// foo + /// + public static void Main() {} + } +} \ No newline at end of file -- 2.11.4.GIT