File tree 1 file changed +6
-4
lines changed
compiler/src/dotty/tools/dotc/printing
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -242,10 +242,12 @@ class PlainPrinter(_ctx: Context) extends Printer {
242
242
val refsText = if showAsCap then rootSetText else toTextCaptureSet(refs)
243
243
toTextCapturing(parent, refsText, boxText)
244
244
case tp @ RetainingType (parent, refs) =>
245
- val refsText = refs match
246
- case ref :: Nil if ref.symbol == defn.captureRoot => rootSetText
247
- case _ => toTextRetainedElems(refs)
248
- toTextCapturing(parent, refsText, " " ) ~ Str (" R" ).provided(printDebug)
245
+ if ctx.compilationUnit.needsCaptureChecking then
246
+ val refsText = refs match
247
+ case ref :: Nil if ref.symbol == defn.captureRoot => rootSetText
248
+ case _ => toTextRetainedElems(refs)
249
+ toTextCapturing(parent, refsText, " " ) ~ Str (" R" ).provided(printDebug)
250
+ else toText(parent)
249
251
case tp : PreviousErrorType if ctx.settings.XprintTypes .value =>
250
252
" <error>" // do not print previously reported error message because they may try to print this error type again recuresevely
251
253
case tp : ErrorType =>
You can’t perform that action at this time.
0 commit comments