Skip to content

Commit 0fd65e6

Browse files
committed
Add missing line break
1 parent 6ac7520 commit 0fd65e6

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

library/src/scala/tasty/util/ShowSourceCode.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,8 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
533533
body match {
534534
case Term.Block(stats, expr) =>
535535
printTrees(stats, lineBreak())
536+
if (stats.nonEmpty)
537+
this += lineBreak()
536538
printTree(expr)
537539
case body =>
538540
printTree(body)

tests/pos/simpleMatchCase.decompiled

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/** Decompiled from out/posTestFromTasty/pos/simpleMatchCase/Foo.class */
2+
class Foo() {
3+
def foo: scala.Unit = {
4+
"c" match {
5+
case x =>
6+
scala.Predef.println("a")
7+
scala.Predef.println("b")
8+
}
9+
}
10+
}

tests/pos/simpleMatchCase.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
class Foo {
3+
def foo: Unit = {
4+
"c" match {
5+
case x =>
6+
println("a")
7+
println("b")
8+
}
9+
}
10+
}

0 commit comments

Comments
 (0)