@@ -1518,7 +1518,7 @@ trait Printers
1518
1518
case Type .IsTypeRef (tpe) =>
1519
1519
val sym = tpe.typeSymbol
1520
1520
tpe.qualifier match {
1521
- case Type .ThisType (Types . EmptyPackage () | Types . RootPackage ()) =>
1521
+ case Type .ThisType (tp) if tp.typeSymbol == defn. RootClass || tp.typeSymbol == defn. EmptyPackageClass =>
1522
1522
case NoPrefix () =>
1523
1523
if (sym.owner.flags.is(Flags .Package )) {
1524
1524
// TODO should these be in the prefix? These are at least `scala`, `java` and `scala.collection`.
@@ -1542,7 +1542,9 @@ trait Printers
1542
1542
1543
1543
case Type .TermRef (prefix, name) =>
1544
1544
prefix match {
1545
- case NoPrefix () | Type .ThisType (Types .EmptyPackage () | Types .RootPackage ()) =>
1545
+ case NoPrefix () =>
1546
+ this += highlightTypeDef(name)
1547
+ case Type .ThisType (tp) if tp.typeSymbol == defn.RootClass || tp.typeSymbol == defn.EmptyPackageClass =>
1546
1548
this += highlightTypeDef(name)
1547
1549
case _ =>
1548
1550
printTypeOrBound(prefix)
@@ -1597,7 +1599,8 @@ trait Printers
1597
1599
this += highlightTypeDef(" .this" )
1598
1600
case Type .TypeRef (prefix, name) if name.endsWith(" $" ) =>
1599
1601
prefix match {
1600
- case NoPrefix () | Type .ThisType (Types .EmptyPackage () | Types .RootPackage ()) =>
1602
+ case NoPrefix () =>
1603
+ case Type .ThisType (tp) if tp.typeSymbol == defn.RootClass || tp.typeSymbol == defn.EmptyPackageClass =>
1601
1604
case _ =>
1602
1605
printTypeOrBound(prefix)
1603
1606
this += " ."
@@ -1903,20 +1906,6 @@ trait Printers
1903
1906
}
1904
1907
}
1905
1908
1906
- object RootPackage {
1907
- def unapply (tpe : TypeOrBounds ) given (ctx : Context ): Boolean = tpe match {
1908
- case Type .IsTypeRef (tpe) => tpe.typeSymbol.fullName == " <root>" // TODO use Symbol.==
1909
- case _ => false
1910
- }
1911
- }
1912
-
1913
- object EmptyPackage {
1914
- def unapply (tpe : TypeOrBounds ) given (ctx : Context ): Boolean = tpe match {
1915
- case Type .IsTypeRef (tpe) => tpe.typeSymbol.fullName == " <empty>"
1916
- case _ => false
1917
- }
1918
- }
1919
-
1920
1909
}
1921
1910
1922
1911
object PackageObject {
0 commit comments