@@ -11,22 +11,6 @@ class UserFacingPrinter(_ctx: Context) extends RefinedPrinter(_ctx) {
11
11
private [this ] def getPkgCls (path : String ) =
12
12
_ctx.requiredPackage(path).moduleClass.asClass
13
13
14
- private lazy val collectionPkg = getPkgCls(" scala.collection" )
15
- private lazy val immutablePkg = getPkgCls(" scala.collection.immutable" )
16
- private lazy val scalaPkg = defn.ScalaPackageClass
17
- private lazy val javaLangPkg = defn.JavaLangPackageVal .moduleClass.asClass
18
-
19
- def standardPkg (pkgSym : Symbol ) = pkgSym match {
20
- case `scalaPkg` | `collectionPkg` | `immutablePkg` | `javaLangPkg` => true
21
- case _ => false
22
- }
23
-
24
- def wrappedName (pkgSym : Symbol ) =
25
- pkgSym.name.toTermName == nme.EMPTY_PACKAGE ||
26
- pkgSym.name.isReplWrapperName
27
-
28
- def wellKnownPkg (pkgSym : Symbol ) = standardPkg(pkgSym) || wrappedName(pkgSym)
29
-
30
14
override protected def keyString (sym : Symbol ): String =
31
15
if (sym.flagsUNSAFE is Package ) " " else super .keyString(sym)
32
16
@@ -55,22 +39,6 @@ class UserFacingPrinter(_ctx: Context) extends RefinedPrinter(_ctx) {
55
39
override def toText (tp : Type ): Text = tp match {
56
40
case ExprType (result) => " :" ~~ toText(result)
57
41
case tp : ConstantType => toText(tp.value)
58
- case tp : TypeRef => tp.info match {
59
- case TypeAlias (alias) => toText(alias)
60
- case _ => toText(tp.info)
61
- }
62
- case tp : ClassInfo => {
63
- if (wellKnownPkg(tp.cls.owner)) nameString(tp.cls.name)
64
- else {
65
- def printPkg (sym : ClassSymbol ): Text =
66
- if (sym.owner == defn.RootClass || wrappedName(sym.owner))
67
- nameString(sym.name.stripModuleClassSuffix)
68
- else
69
- printPkg(sym.owner.asClass) ~ " ." ~ toText(sym)
70
-
71
- printPkg(tp.cls.owner.asClass) ~ " ." ~ nameString(tp.cls.name)
72
- }
73
- }
74
42
case tp => super .toText(tp)
75
43
}
76
44
}
0 commit comments