Skip to content

Commit c64de22

Browse files
committed
Improve printing of local roots.
1 parent 5fd589e commit c64de22

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ class PlainPrinter(_ctx: Context) extends Printer {
150150
+ defn.FromJavaObjectSymbol
151151

152152
def toTextCaptureSet(cs: CaptureSet): Text =
153-
if printDebug && !cs.isConst then cs.toString
153+
if printDebug && ctx.settings.YccDebug.value && !cs.isConst then cs.toString
154154
else if cs == CaptureSet.Fluid then "<fluid>"
155155
else
156156
val core: Text =
@@ -361,7 +361,8 @@ class PlainPrinter(_ctx: Context) extends Printer {
361361
def toTextRef(tp: SingletonType): Text = controlled {
362362
tp match {
363363
case tp: TermRef =>
364-
if tp.isLocalRootCapability then Str(s"<cap in ${tp.localRootOwner.name}/${tp.symbol.ccNestingLevel}>")
364+
if tp.symbol.name == nme.LOCAL_CAPTURE_ROOT then
365+
Str(s"cap[${tp.localRootOwner.name}]@${tp.symbol.ccNestingLevel}")
365366
else toTextPrefixOf(tp) ~ selectionString(tp)
366367
case tp: ThisType =>
367368
nameString(tp.cls) + ".this"

0 commit comments

Comments
 (0)