File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
compiler/src/dotty/tools/dotc/printing Expand file tree Collapse file tree 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) {
527527 case RefinedTypeTree (tpt, refines) =>
528528 toTextLocal(tpt) ~ " " ~ blockText(refines)
529529 case AppliedTypeTree (tpt, args) =>
530- if ( tpt.symbol == defn.orType && args.length == 2 )
530+ if tpt.symbol == defn.orType && args.length == 2 then
531531 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
533533 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 )) }
534536 else if defn.isFunctionClass(tpt.symbol)
535537 && tpt.isInstanceOf [TypeTree ] && tree.hasType && ! printDebug
536- then changePrec(GlobalPrec ) { toText(tree.typeOpt) }
538+ then
539+ changePrec(GlobalPrec ) { toText(tree.typeOpt) }
537540 else args match
538541 case arg :: _ if arg.isTerm =>
539542 toTextLocal(tpt) ~ " (" ~ Text (args.map(argText), " , " ) ~ " )"
You can’t perform that action at this time.
0 commit comments