Skip to content

Commit 51358f3

Browse files
committed
Don't forget braces around partial functions
When rewriting an indented list of cases to -noindent, put braces around them.
1 parent d013e63 commit 51358f3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

compiler/src/dotty/tools/dotc/parsing/Parsers.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,7 @@ object Parsers {
654654
}
655655

656656
def needsBraces(t: Any): Boolean = t match {
657+
case Match(EmptyTree, _) => true
657658
case Block(stats, expr) =>
658659
stats.nonEmpty || needsBraces(expr)
659660
case expr: Tree =>

0 commit comments

Comments
 (0)