Skip to content

Commit 6b3b446

Browse files
committed
More low-level printing under -Yprint-debug
1 parent 32c93e4 commit 6b3b446

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Diff for: compiler/src/dotty/tools/dotc/printing/PlainPrinter.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ class PlainPrinter(_ctx: Context) extends Printer {
429429
def toText(sym: Symbol): Text =
430430
(kindString(sym) ~~ {
431431
if (sym.isAnonymousClass) toTextParents(sym.info.parents) ~~ "{...}"
432-
else if (hasMeaninglessName(sym)) simpleNameString(sym.owner) + idString(sym)
432+
else if (hasMeaninglessName(sym) && !printDebug) simpleNameString(sym.owner) + idString(sym)
433433
else nameString(sym)
434434
}).close
435435

Diff for: compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala

+4-2
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)
@@ -851,7 +851,9 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
851851
case _ =>
852852
}
853853
def name =
854-
if (sym.is(ModuleClass) && sym.isPackageObject && sym.name.stripModuleClassSuffix == tpnme.PACKAGE)
854+
if (printDebug)
855+
nameString(sym)
856+
else if (sym.is(ModuleClass) && sym.isPackageObject && sym.name.stripModuleClassSuffix == tpnme.PACKAGE)
855857
nameString(sym.owner.name)
856858
else if (sym.is(ModuleClass))
857859
nameString(sym.name.stripModuleClassSuffix)

0 commit comments

Comments
 (0)