Skip to content

Commit

Permalink
Fix empty line between try and finally with no catch
Browse files Browse the repository at this point in the history
closes #454
  • Loading branch information
belav committed Oct 13, 2021
1 parent 8bfd431 commit 3cf526d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ class ClassName
try { }
catch { }

try { }
finally { }

try
{
throw null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static Doc Print(TryStatementSyntax node)
AttributeLists.Print(node, node.AttributeLists),
Token.Print(node.TryKeyword),
Block.Print(node.Block),
Doc.HardLine,
node.Catches.Any() ? Doc.HardLine : Doc.Null,
Doc.Join(Doc.HardLine, node.Catches.Select(CatchClause.Print))
};
if (node.Finally != null)
Expand Down

0 comments on commit 3cf526d

Please sign in to comment.