Skip to content

Commit b78ca99

Browse files
committed
Simpify code
1 parent af822e1 commit b78ca99

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

compiler/src/dotty/tools/dotc/printing/DecompilerPrinter.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class DecompilerPrinter(_ctx: Context) extends RefinedPrinter(_ctx) {
3939
if (tree.pid.symbol.isEmptyPackage) statsText
4040
else if (currentPrecedence == TopLevelPrec) "\n" ~ statsText
4141
else " {" ~ statsText ~ "}"
42-
(keywordStr("package ") ~ toTextPackageId(tree.pid)).provided(!tree.pid.symbol.isEmptyPackage) ~ bodyText
42+
(keywordStr("package ") ~ toTextPackageId(tree.pid)).provided(!tree.symbol.isEmptyPackage) ~ bodyText
4343
}
4444

4545
override protected def templateText(tree: TypeDef, impl: Template): Text = {
@@ -50,8 +50,7 @@ class DecompilerPrinter(_ctx: Context) extends RefinedPrinter(_ctx) {
5050
}
5151

5252
override protected def toTextTemplate(impl: Template, ofNew: Boolean = false): Text = {
53-
val Template(constr, parents, self, preBody) = impl
54-
val impl1 = Template(constr, parents.filterNot(_.symbol.maybeOwner == defn.ObjectClass), self, preBody)
53+
val impl1 = impl.copy(parents = impl.parents.filterNot(_.symbol.maybeOwner == defn.ObjectClass))
5554
super.toTextTemplate(impl1, ofNew)
5655
}
5756

0 commit comments

Comments
 (0)