@@ -750,9 +750,6 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
750
750
printTypeAndAnnots(tp)
751
751
this += " "
752
752
printAnnotation(annot)
753
- case tpe @ Type .TypeRef (name, _) if name.endsWith(" $" ) =>
754
- printType(tpe)
755
- this += " .type"
756
753
case Type .SymRef (ClassDef (" Null$" | " Nothing$" , _, _, _, _), Type .ThisType (Type .SymRef (PackageDef (" runtime" , _), NoPrefix ()))) =>
757
754
// scala.runtime.Null$ and scala.runtime.Nothing$ are not modules, those are their actual names
758
755
printType(tpe)
@@ -865,7 +862,8 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
865
862
case NoPrefix () | Type .ThisType (Types .EmptyPackage ()) =>
866
863
case prefix@ Type () => printType(prefix) += " ."
867
864
}
868
- this += name.stripSuffix(" $" )
865
+ if (name.endsWith(" $" )) this += name.stripSuffix(" $" ) += " .type"
866
+ else this += name
869
867
870
868
case tpe @ Type .Refinement (_, _, _) =>
871
869
printRefinement(tpe)
@@ -904,7 +902,15 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
904
902
case Type .SymRef (cdef @ ClassDef (_, _, _, _, _), _) if ! cdef.flags.isObject =>
905
903
printFullClassName(tp)
906
904
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)
908
914
}
909
915
910
916
case Type .TypeLambda (paramNames, tparams, body) =>
0 commit comments