Skip to content

Commit 5054a74

Browse files
committed
More low-level printing under -Yprint-debug
1 parent 0ae1c56 commit 5054a74

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ class PlainPrinter(_ctx: Context) extends Printer {
426426
def toText(sym: Symbol): Text =
427427
(kindString(sym) ~~ {
428428
if (sym.isAnonymousClass) toTextParents(sym.info.parents) ~~ "{...}"
429-
else if (hasMeaninglessName(sym)) simpleNameString(sym.owner) + idString(sym)
429+
else if (hasMeaninglessName(sym) && !printDebug) simpleNameString(sym.owner) + idString(sym)
430430
else nameString(sym)
431431
}).close
432432

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
9393
tp match {
9494
case tp: ThisType if !printDebug =>
9595
if (tp.cls.isAnonymousClass) return keywordStr("this")
96-
if (tp.cls is ModuleClass) return fullNameString(tp.cls.sourceModule)
96+
if (tp.cls.is(ModuleClass)) return fullNameString(tp.cls.sourceModule)
9797
case _ =>
9898
}
9999
super.toTextRef(tp)
@@ -841,7 +841,9 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
841841
case _ =>
842842
}
843843
def name =
844-
if (sym.is(ModuleClass) && sym.isPackageObject && sym.name.stripModuleClassSuffix == tpnme.PACKAGE)
844+
if (printDebug)
845+
nameString(sym)
846+
else if (sym.is(ModuleClass) && sym.isPackageObject && sym.name.stripModuleClassSuffix == tpnme.PACKAGE)
845847
nameString(sym.owner.name)
846848
else if (sym.is(ModuleClass))
847849
nameString(sym.name.stripModuleClassSuffix)

0 commit comments

Comments
 (0)