Skip to content

RCS1016 result doesn't compile fix#1090

Merged
josefpihrt merged 2 commits intodotnet:mainfrom
jamesHargreaves12:fix/RCS1016
Jun 1, 2023
Merged

RCS1016 result doesn't compile fix#1090
josefpihrt merged 2 commits intodotnet:mainfrom
jamesHargreaves12:fix/RCS1016

Conversation

@jamesHargreaves12
Copy link
Copy Markdown
Contributor

If there is a trailing comment after an arrow expression then applying RCS1016 will produce code that fails to compile as the trailing '}' will be appended to the comment.

For example:

string P => null; // some comment

becomes:

string P { 
    get { return null;// some comment}
}

The cause is that the WhitespaceRemover is removing newlines even if they are preceded by a comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants