Skip to content

Commit 38e0989

Browse files
committed
Fix missing line break after top level class definitions
1 parent 4bc6e07 commit 38e0989

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

compiler/src/dotty/tools/dotc/decompiler/DecompilationPrinter.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class DecompilationPrinter extends Phase {
4141
new TastyPrinter(unit.pickled.head._2).printContents()
4242
} else {
4343
out.println(s"/** Decompiled from $unit */")
44-
out.print(TastyImpl.showSourceCode.showTree(unit.tpdTree)(ctx))
44+
out.println(TastyImpl.showSourceCode.showTree(unit.tpdTree)(ctx))
4545
}
4646
}
4747
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
5252
this += lineBreak()
5353
printTrees(stats1, lineBreak())
5454
}
55-
this += lineBreak() += "}" += lineBreak()
55+
this += lineBreak() += "}"
5656
}
5757

5858
case Import(expr, selectors) =>

tests/pos/simpleExractors.decompiled

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
/** Decompiled from out/posTestFromTasty/pos/simpleExractors/Bar.class */
22
object Bar {
33
def unapply(arg: scala.Any): scala.Option[scala.Any] = scala.Some.apply[scala.Any](arg)
4-
}/** Decompiled from out/posTestFromTasty/pos/simpleExractors/BarSeq.class */
4+
}
5+
/** Decompiled from out/posTestFromTasty/pos/simpleExractors/BarSeq.class */
56
object BarSeq {
67
def unapplySeq(arg: scala.Any): scala.Option[scala.Seq[scala.Any]] = scala.Some.apply[collection.immutable.List[scala.Any]](scala.List.apply[scala.Any](arg))
7-
}/** Decompiled from out/posTestFromTasty/pos/simpleExractors/Baz.class */
8+
}
9+
/** Decompiled from out/posTestFromTasty/pos/simpleExractors/Baz.class */
810
object Baz {
911
def unapply[T](arg: T): scala.Option[T] = scala.Some.apply[T](arg)
10-
}/** Decompiled from out/posTestFromTasty/pos/simpleExractors/BazSeq.class */
12+
}
13+
/** Decompiled from out/posTestFromTasty/pos/simpleExractors/BazSeq.class */
1114
object BazSeq {
1215
def unapplySeq[T](arg: T): scala.Option[scala.Seq[T]] = scala.Some.apply[collection.immutable.List[T]](scala.List.apply[T](arg))
13-
}/** Decompiled from out/posTestFromTasty/pos/simpleExractors/Foo.class */
16+
}
17+
/** Decompiled from out/posTestFromTasty/pos/simpleExractors/Foo.class */
1418
class Foo() {
1519
def bar(x: scala.Any): scala.Unit = x match {
1620
case Bar(a) =>

0 commit comments

Comments
 (0)