@@ -500,34 +500,41 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
500
500
501
501
def printTargDef (arg : TypeDef , isMember : Boolean = false ): Buffer = {
502
502
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
+ }
503
518
this += name
504
519
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)
518
521
case rhs @ SyntheticBounds () =>
519
522
printTypeOrBound(rhs.tpe)
520
523
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
+ }
521
528
def printSeparated (list : List [TypeDef ]): Unit = list match {
522
529
case Nil =>
523
530
case x :: Nil =>
524
531
val TypeDef (name, trhs) = x
525
532
this += name
526
- printTypeOrBoundsTree (trhs)
533
+ printParam (trhs)
527
534
case x :: xs =>
528
535
val TypeDef (name, trhs) = x
529
536
this += name
530
- printTypeOrBoundsTree (trhs)
537
+ printParam (trhs)
531
538
this += " , "
532
539
printSeparated(xs)
533
540
}
0 commit comments