Bug 5219 - [AST] Code formatter removes code on closing } of auto property
Summary: [AST] Code formatter removes code on closing } of auto property
Status: NEW
Alias: None
Product: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: unspecified
Hardware: PC Mac OS
: High normal
Target Milestone: ---
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2012-05-21 16:19 UTC by Mikayla Hutchinson [MSFT]
Modified: 2013-03-22 09:54 UTC (History)
3 users (show)

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


Attachments

Description Mikayla Hutchinson [MSFT] 2012-05-21 16:19:36 UTC
When placing the final } on a single-line auto property, the code formatter removes the following two lines of code: http://screencast.com/t/7JgmNoTzLEM
Comment 1 Mike Krüger 2012-05-22 05:03:10 UTC
Test case:

The closing '}' is wrongly choosen as part of the Options property. In that case it would be the best if the '}' is just missing from the Options property, if the next c# token after the set; isn't '}'.

btw. that would allow that the method after the missing '}' is inserted in the AST as well.

-------------------------------------------------------
using System;

namespace TestConsole
{
	class MainClass
	{
		internal Dictionary<string,bool> Options { get; set; 

		public static void Main (string[] args)
		{
			Console.WriteLine();
		}
	}
}
-------------------------------------------------------
Comment 2 Marek Safar 2013-03-22 09:53:56 UTC
The bug is that  public static void Main (string[] args) is missing in AST due to another layer of hacks in accessor_declarations

Note You need to log in before you can comment on or make changes to this bug.