Skip to content

Commit 4a45939

Browse files
committed
Fix printing of nesting levels
1 parent bc522cc commit 4a45939

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,10 @@ class PlainPrinter(_ctx: Context) extends Printer {
349349
*/
350350
protected def idString(sym: Symbol): String =
351351
(if (showUniqueIds || Printer.debugPrintUnique) "#" + sym.id else "") +
352-
(if (showNestingLevel) "%" + sym.nestingLevel else "")
352+
(if showNestingLevel then
353+
if ctx.phase == Phases.checkCapturesPhase then "%" + sym.ccNestingLevel
354+
else "%" + sym.nestingLevel
355+
else "")
353356

354357
def nameString(sym: Symbol): String =
355358
simpleNameString(sym) + idString(sym) // + "<" + (if (sym.exists) sym.owner else "") + ">"

0 commit comments

Comments
 (0)