File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
compiler/src/dotty/tools/dotc/printing Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -189,13 +189,14 @@ class PlainPrinter(_ctx: Context) extends Printer {
189
189
(" <: " ~ toText(bound) provided ! bound.isAny)
190
190
}.close
191
191
case CapturingType (parent, refs) =>
192
- if refs.isConst then
193
- if Config .printCaptureSetsAsPrefix then
194
- changePrec(GlobalPrec )(" {" ~ Text (refs.elems.toList.map(toTextCaptureRef), " , " ) ~ " } " ~ toText(parent))
195
- else
196
- changePrec(InfixPrec )(toText(parent) ~ " retains " ~ toText(refs.toRetainsTypeArg))
192
+ if printDebug && ! refs.isConst then
193
+ s " $refs " ~ toText(parent)
194
+ else if refs.elems.isEmpty then
195
+ toText(parent)
196
+ else if Config .printCaptureSetsAsPrefix then
197
+ changePrec(GlobalPrec )(" {" ~ Text (refs.elems.toList.map(toTextCaptureRef), " , " ) ~ " } " ~ toText(parent))
197
198
else
198
- s " $refs " ~ toText(parent) // ^^^ improve
199
+ changePrec( InfixPrec )(toText(parent) ~ " retains " ~ toText(refs.toRetainsTypeArg))
199
200
case tp : PreviousErrorType if ctx.settings.XprintTypes .value =>
200
201
" <error>" // do not print previously reported error message because they may try to print this error type again recuresevely
201
202
case tp : ErrorType =>
You can’t perform that action at this time.
0 commit comments