Skip to content

Commit 5e09178

Browse files
committed
Revise printing of CaptureRoot.Vars
1 parent 7d9a288 commit 5e09178

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -402,11 +402,11 @@ class PlainPrinter(_ctx: Context) extends Printer {
402402
if tp.followAlias ne tp then toTextRef(tp.followAlias)
403403
else
404404
def boundText(sym: Symbol): Text =
405-
if sym.exists then toTextRef(sym.termRef) ~ s"/${sym.ccNestingLevel}"
406-
else ""
407-
"'cap[" ~ nameString(tp.source)
408-
~ "](" ~ boundText(tp.lowerBound)
409-
~ ".." ~ boundText(tp.upperBound) ~ ")"
405+
(toTextRef(sym.termRef)
406+
~ Str(s"/${sym.ccNestingLevel}").provided(showNestingLevel)
407+
).provided(sym.exists)
408+
"'cap[" ~ boundText(tp.lowerBound) ~ ".." ~ boundText(tp.upperBound) ~ "]"
409+
~ ("(from instantiating " ~ nameString(tp.source) ~ ")").provided(tp.source.exists)
410410
}
411411
}
412412

0 commit comments

Comments
 (0)