@@ -500,34 +500,41 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
500500
501501 def printTargDef (arg : TypeDef , isMember : Boolean = false ): Buffer = {
502502 val TypeDef (name, rhs) = arg
503+ def printBounds (bounds : TypeBoundsTree ): Buffer = {
504+ val TypeBoundsTree (lo, hi) = bounds
505+ lo match {
506+ case TypeTree .Synthetic () =>
507+ case _ =>
508+ this += " >: "
509+ printTypeTree(lo)
510+ }
511+ hi match {
512+ case TypeTree .Synthetic () => this
513+ case _ =>
514+ this += " <: "
515+ printTypeTree(hi)
516+ }
517+ }
503518 this += name
504519 rhs match {
505- case TypeBoundsTree (lo, hi) =>
506- lo match {
507- case TypeTree .Synthetic () => this
508- case _ =>
509- this += " >: "
510- printTypeTree(lo)
511- }
512- hi match {
513- case TypeTree .Synthetic () => this
514- case _ =>
515- this += " <: "
516- printTypeTree(hi)
517- }
520+ case rhs @ TypeBoundsTree (lo, hi) => printBounds(rhs)
518521 case rhs @ SyntheticBounds () =>
519522 printTypeOrBound(rhs.tpe)
520523 case rhs @ TypeTree .TypeLambdaTree (tparams, body) =>
524+ def printParam (t : TypeOrBoundsTree ): Unit = t match {
525+ case t @ TypeBoundsTree (_, _) => printBounds(t)
526+ case t @ TypeTree () => printTypeTree(t)
527+ }
521528 def printSeparated (list : List [TypeDef ]): Unit = list match {
522529 case Nil =>
523530 case x :: Nil =>
524531 val TypeDef (name, trhs) = x
525532 this += name
526- printTypeOrBoundsTree (trhs)
533+ printParam (trhs)
527534 case x :: xs =>
528535 val TypeDef (name, trhs) = x
529536 this += name
530- printTypeOrBoundsTree (trhs)
537+ printParam (trhs)
531538 this += " , "
532539 printSeparated(xs)
533540 }
0 commit comments