Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parenthesis simplification around binary expressions #17241

Merged
merged 4 commits into from
Feb 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -4157,5 +4157,31 @@ public class KVP<T1, T2>

await TestAsync(code, expected, index: 0);
}

[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsInlineTemporary)]
[WorkItem(11958, "https://github.com/dotnet/roslyn/issues/11958")]
public async Task EnsureParenthesesInStringConcatenation()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's a new test

{
var code = @"
class C
{
void M()
{
int [||]i = 1 + 2;
string s = ""a"" + i;
}
}";

var expected = @"
class C
{
void M()
{
string s = ""a"" + (1 + 2);
}
}";

await TestAsync(code, expected, index: 0, compareTokens: false);
}
}
}