@@ -458,7 +458,8 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
458
458
case ByNameTypeTree (tpt) =>
459
459
" => " ~ toTextLocal(tpt)
460
460
case TypeBoundsTree (lo, hi) =>
461
- optText(lo)(" >: " ~ _) ~ optText(hi)(" <: " ~ _)
461
+ if (lo eq hi) optText(lo)(" = " ~ _)
462
+ else optText(lo)(" >: " ~ _) ~ optText(hi)(" <: " ~ _)
462
463
case Bind (name, body) =>
463
464
changePrec(InfixPrec ) { toText(name) ~ " @ " ~ toText(body) }
464
465
case Alternative (trees) =>
@@ -489,10 +490,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
489
490
def typeDefText (tparamsText : => Text , rhsText : => Text ) =
490
491
dclTextOr {
491
492
modText(tree.mods, keywordStr(" type" )) ~~ (varianceText(tree.mods) ~ typeText(nameIdText(tree))) ~
492
- withEnclosingDef(tree) {
493
- if (tree.hasType) toText(tree.symbol.info) // TODO: always print RHS, once we pickle/unpickle type trees
494
- else tparamsText ~ rhsText
495
- }
493
+ withEnclosingDef(tree) { tparamsText ~ rhsText }
496
494
}
497
495
def recur (rhs : Tree , tparamsTxt : => Text ): Text = rhs match {
498
496
case impl : Template =>
@@ -503,6 +501,8 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
503
501
typeDefText(tparamsTxt, toText(rhs))
504
502
case LambdaTypeTree (tparams, body) =>
505
503
recur(body, tparamsText(tparams))
504
+ case rhs : TypeTree if rhs.tpe.isInstanceOf [TypeBounds ] =>
505
+ typeDefText(tparamsTxt, toText(rhs))
506
506
case rhs =>
507
507
typeDefText(tparamsTxt, optText(rhs)(" = " ~ _))
508
508
}
0 commit comments