@@ -15,7 +15,7 @@ import util.SourcePosition
15
15
import scala .util .control .NonFatal
16
16
import scala .annotation .switch
17
17
import config .Config
18
- import cc .CapturingType
18
+ import cc .{ CapturingType , CaptureSet }
19
19
20
20
class PlainPrinter (_ctx : Context ) extends Printer {
21
21
/** The context of all public methods in Printer and subclasses.
@@ -189,13 +189,20 @@ class PlainPrinter(_ctx: Context) extends Printer {
189
189
(" <: " ~ toText(bound) provided ! bound.isAny)
190
190
}.close
191
191
case CapturingType (parent, refs, boxed) =>
192
+ def refsId = refs match
193
+ case refs : CaptureSet .Var if ctx.settings.YccDebug .value => refs.id.toString
194
+ case _ => " "
192
195
def box = Str (" box " ) provided boxed
193
196
if printDebug && ! refs.isConst then
194
197
changePrec(GlobalPrec )(box ~ s " $refs " ~ toText(parent))
195
198
else if ! refs.isConst && refs.elems.isEmpty then
196
- changePrec(GlobalPrec )(" ? " ~ toText(parent))
199
+ changePrec(GlobalPrec )(" ?" ~ refsId ~ " " ~ toText(parent))
197
200
else if Config .printCaptureSetsAsPrefix then
198
- changePrec(GlobalPrec )(box ~ " {" ~ Text (refs.elems.toList.map(toTextCaptureRef), " , " ) ~ " } " ~ toText(parent))
201
+ changePrec(GlobalPrec )(
202
+ box ~ " {"
203
+ ~ Text (refs.elems.toList.map(toTextCaptureRef), " , " )
204
+ ~ " }" ~ refsId
205
+ ~ " " ~ toText(parent))
199
206
else
200
207
changePrec(InfixPrec )(toText(parent) ~ " retains " ~ box ~ toText(refs.toRetainsTypeArg))
201
208
case tp : PreviousErrorType if ctx.settings.XprintTypes .value =>
0 commit comments