File tree 1 file changed +6
-3
lines changed
compiler/src/dotty/tools/dotc/printing
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -527,13 +527,16 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
527
527
case RefinedTypeTree (tpt, refines) =>
528
528
toTextLocal(tpt) ~ " " ~ blockText(refines)
529
529
case AppliedTypeTree (tpt, args) =>
530
- if ( tpt.symbol == defn.orType && args.length == 2 )
530
+ if tpt.symbol == defn.orType && args.length == 2 then
531
531
changePrec(OrTypePrec ) { toText(args(0 )) ~ " | " ~ atPrec(OrTypePrec + 1 ) { toText(args(1 )) } }
532
- else if ( tpt.symbol == defn.andType && args.length == 2 )
532
+ else if tpt.symbol == defn.andType && args.length == 2 then
533
533
changePrec(AndTypePrec ) { toText(args(0 )) ~ " & " ~ atPrec(AndTypePrec + 1 ) { toText(args(1 )) } }
534
+ else if tpt.symbol == defn.Predef_retainsType && args.length == 2 then
535
+ changePrec(InfixPrec ) { toText(args(0 )) ~ " retains " ~ toText(args(1 )) }
534
536
else if defn.isFunctionClass(tpt.symbol)
535
537
&& tpt.isInstanceOf [TypeTree ] && tree.hasType && ! printDebug
536
- then changePrec(GlobalPrec ) { toText(tree.typeOpt) }
538
+ then
539
+ changePrec(GlobalPrec ) { toText(tree.typeOpt) }
537
540
else args match
538
541
case arg :: _ if arg.isTerm =>
539
542
toTextLocal(tpt) ~ " (" ~ Text (args.map(argText), " , " ) ~ " )"
You can’t perform that action at this time.
0 commit comments