Skip to content

Commit fe422e4

Browse files
committed
Drop special case when printing package objects
Since there are now several possible toplevel source files, we can't just print "in package object <name-of-enclosing-package>". I am not yet quite sure what to do instead. For the moment, we just print the name of the generated object.
1 parent 4c53c67 commit fe422e4

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -800,12 +800,8 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
800800
case info: ImportType => return s"import $info.expr.show"
801801
case _ =>
802802
}
803-
if (sym.is(ModuleClass)) {
804-
val name =
805-
if (sym.isPackageObject) sym.owner.name
806-
else sym.name.stripModuleClassSuffix
807-
kindString(sym) ~~ (nameString(name) + idString(sym))
808-
}
803+
if (sym.is(ModuleClass))
804+
kindString(sym) ~~ (nameString(sym.name.stripModuleClassSuffix) + idString(sym))
809805
else
810806
super.toText(sym)
811807
}

0 commit comments

Comments
 (0)