@@ -475,34 +475,41 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
475
475
476
476
def printTargDef (arg : TypeDef , isMember : Boolean = false ): Buffer = {
477
477
val TypeDef (name, rhs) = arg
478
+ def printBounds (bounds : TypeBoundsTree ): Buffer = {
479
+ val TypeBoundsTree (lo, hi) = bounds
480
+ lo match {
481
+ case TypeTree .Synthetic () =>
482
+ case _ =>
483
+ this += " >: "
484
+ printTypeTree(lo)
485
+ }
486
+ hi match {
487
+ case TypeTree .Synthetic () => this
488
+ case _ =>
489
+ this += " <: "
490
+ printTypeTree(hi)
491
+ }
492
+ }
478
493
this += name
479
494
rhs match {
480
- case TypeBoundsTree (lo, hi) =>
481
- lo match {
482
- case TypeTree .Synthetic () => this
483
- case _ =>
484
- this += " >: "
485
- printTypeTree(lo)
486
- }
487
- hi match {
488
- case TypeTree .Synthetic () => this
489
- case _ =>
490
- this += " <: "
491
- printTypeTree(hi)
492
- }
495
+ case rhs @ TypeBoundsTree (lo, hi) => printBounds(rhs)
493
496
case rhs @ SyntheticBounds () =>
494
497
printTypeOrBound(rhs.tpe)
495
498
case rhs @ TypeTree .TypeLambdaTree (tparams, body) =>
499
+ def printParam (t : TypeOrBoundsTree ): Unit = t match {
500
+ case t @ TypeBoundsTree (_, _) => printBounds(t)
501
+ case t @ TypeTree () => printTypeTree(t)
502
+ }
496
503
def printSeparated (list : List [TypeDef ]): Unit = list match {
497
504
case Nil =>
498
505
case x :: Nil =>
499
506
val TypeDef (name, trhs) = x
500
507
this += name
501
- printTypeOrBoundsTree (trhs)
508
+ printParam (trhs)
502
509
case x :: xs =>
503
510
val TypeDef (name, trhs) = x
504
511
this += name
505
- printTypeOrBoundsTree (trhs)
512
+ printParam (trhs)
506
513
this += " , "
507
514
printSeparated(xs)
508
515
}
0 commit comments