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# ()
Version: unspecified
Hardware: PC Mac OS
: High normal
Target Milestone: ---
Assignee: Marek Safar
Depends on:
Reported: 2012-05-21 16:19 UTC by Mikayla Hutchinson [MSFT]
Modified: 2013-03-22 09:54 UTC (History)
3 users (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 for Bug 5219 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

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)
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