Bug 32456

Summary: Expression-bodied properties cause issues in conjunction with XML comments
Product: [Mono] Compilers Reporter: Shay Rojansky <roji>
Component: C#Assignee: Marek Safar <masafa>
Status: RESOLVED FIXED    
Severity: normal CC: mono-bugs+mono
Priority: ---    
Version: 4.0.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Tags: Is this bug a regression?: ---
Last known good build:

Description Shay Rojansky 2015-07-26 08:37:39 UTC
Using mono (ubuntu with 4.0.2.5-0xamarin1), compiling the following:

/// <summary>
/// foo
/// </summary>
public sealed class NpgsqlException : Exception
{
	public string Severity => "foo";

	/// <summary>
	/// foo
	/// </summary>
	public static void Main() {}
}

Yields the following compilation warnings:

warning CS1587: XML comment is not placed on a valid language element
warning CS1591: Missing XML comment for publicly visible type or member `Npgsql.NpgsqlException.Severity'
warning CS1591: Missing XML comment for publicly visible type or member `Npgsql.NpgsqlException.Main()'

The first warning seems to be a compiler bug. Turning on warnings as errors means the valid code cannot compile. Removing the Severity property makes the problem go away.
Comment 1 Marek Safar 2015-07-27 08:10:53 UTC
Fixed in master and Mono 4.2