You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Extensions/ParenthesizedExpressionSyntaxExtensions.cs
+16-11Lines changed: 16 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -110,15 +110,29 @@ public static bool CanRemoveParentheses(
110
110
if(expression.IsKind(SyntaxKind.TupleExpression))
111
111
returntrue;
112
112
113
+
// Cases:
114
+
// {(x)} -> {x}
115
+
if(nodeParentisInitializerExpressionSyntax)
116
+
{
117
+
// `{ ([]) }` can't become `{ [] }` as `[` in an initializer will be parsed as an index assignment.
0 commit comments