@@ -48,6 +48,11 @@ class PlainPrinter(_ctx: Context) extends Printer {
48
48
protected def homogenizedView : Boolean = ctx.settings.YtestPickler .value
49
49
protected def debugPos : Boolean = ctx.settings.YdebugPos .value
50
50
51
+ /** If true, shorten local roots of current owner tp `cap`,
52
+ * TODO: we should drop this switch once we implemented disambiguation of capture roots.
53
+ */
54
+ private val shortenCap = true
55
+
51
56
def homogenize (tp : Type ): Type =
52
57
if (homogenizedView)
53
58
tp match {
@@ -166,7 +171,7 @@ class PlainPrinter(_ctx: Context) extends Printer {
166
171
boxText ~ toTextLocal(parent) ~ " ^"
167
172
~ (refsText provided refsText != rootSetText)
168
173
169
- final protected def rootSetText = Str (" {cap}" )
174
+ final protected def rootSetText = Str (" {cap}" ) // TODO Use disambiguation
170
175
171
176
def toText (tp : Type ): Text = controlled {
172
177
homogenize(tp) match {
@@ -238,6 +243,7 @@ class PlainPrinter(_ctx: Context) extends Printer {
238
243
tp.symbol.name == nme.LOCAL_CAPTURE_ROOT
239
244
&& ctx.owner.levelOwner == tp.localRootOwner
240
245
&& ! printDebug
246
+ && shortenCap // !!!
241
247
// local roots get printed as themselves under printDebug
242
248
case _ =>
243
249
false
@@ -374,7 +380,7 @@ class PlainPrinter(_ctx: Context) extends Printer {
374
380
tp match {
375
381
case tp : TermRef =>
376
382
if tp.symbol.name == nme.LOCAL_CAPTURE_ROOT then // TODO: Move to toTextCaptureRef
377
- if ctx.owner.levelOwner == tp.localRootOwner && ! printDebug then
383
+ if ctx.owner.levelOwner == tp.localRootOwner && ! printDebug && shortenCap then
378
384
Str (" cap" )
379
385
else
380
386
Str (s " cap[ ${tp.localRootOwner.name}] " ) ~
0 commit comments