Bug 35087 - Incorrect CS1587 warning for comment on C#6 auto-property initializer
Summary: Incorrect CS1587 warning for comment on C#6 auto-property initializer
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: Marek Safar
Depends on:
Reported: 2015-10-20 08:52 UTC by Alexander Köplinger [MSFT]
Modified: 2015-10-20 12:39 UTC (History)
1 user (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Alexander Köplinger [MSFT] 2015-10-20 08:52:25 UTC
Repro code:

> 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 { get; set; }
> }


> mcs -t:library -doc:test.xml test.cs


> test.cs(9,3): warning CS1587: XML comment is not placed on a valid language element
> test.cs(10,19): warning CS1591: Missing XML comment for publicly visible type or member `Test.TestFoo'
> Compilation succeeded - 2 warning(s)

The line in the first warning message doesn't make sense, it seems to be confused by the C#6 auto-property initializer above.

This breaks when warning-as-errors in turned on (I found this in xunit).

Reproduces in 4.0, 4.2 and master.
Comment 1 Marek Safar 2015-10-20 12:39:43 UTC
Fixed in master