@@ -750,9 +750,6 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
750750 printTypeAndAnnots(tp)
751751 this += " "
752752 printAnnotation(annot)
753- case tpe @ Type .TypeRef (name, _) if name.endsWith(" $" ) =>
754- printType(tpe)
755- this += " .type"
756753 case Type .SymRef (ClassDef (" Null$" | " Nothing$" , _, _, _, _), Type .ThisType (Type .SymRef (PackageDef (" runtime" , _), NoPrefix ()))) =>
757754 // scala.runtime.Null$ and scala.runtime.Nothing$ are not modules, those are their actual names
758755 printType(tpe)
@@ -865,7 +862,8 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
865862 case NoPrefix () | Type .ThisType (Types .EmptyPackage ()) =>
866863 case prefix@ Type () => printType(prefix) += " ."
867864 }
868- this += name.stripSuffix(" $" )
865+ if (name.endsWith(" $" )) this += name.stripSuffix(" $" ) += " .type"
866+ else this += name
869867
870868 case tpe @ Type .Refinement (_, _, _) =>
871869 printRefinement(tpe)
@@ -904,7 +902,15 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
904902 case Type .SymRef (cdef @ ClassDef (_, _, _, _, _), _) if ! cdef.flags.isObject =>
905903 printFullClassName(tp)
906904 this += " .this"
907- case _ => printType(tp)
905+ case Type .TypeRef (name, prefix) if name.endsWith(" $" ) =>
906+ prefix match {
907+ case Types .EmptyPrefix () =>
908+ case _ =>
909+ printTypeOrBound(prefix) += " ."
910+ }
911+ this += name.stripSuffix(" $" )
912+ case _ =>
913+ printType(tp)
908914 }
909915
910916 case Type .TypeLambda (paramNames, tparams, body) =>
0 commit comments