Skip to content

Commit a945652

Browse files
committed
Remove dead code
- unexpandedName in names that cannot be expanded - meregTypeParamsAndAliases in TreeUnpickler (there are no such aliases anymore). - ModuleVarName
1 parent 5ee0f97 commit a945652

File tree

6 files changed

+6
-18
lines changed

6 files changed

+6
-18
lines changed

compiler/src/dotty/tools/dotc/core/Definitions.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class Definitions {
6767
enterTypeField(cls, name, flags | ClassTypeParamCreationFlags, scope)
6868

6969
private def enterSyntheticTypeParam(cls: ClassSymbol, paramFlags: FlagSet, scope: MutableScope, suffix: String = "T0") =
70-
enterTypeParam(cls, suffix.toTypeName.expandedName(cls), paramFlags, scope)
70+
enterTypeParam(cls, suffix.toTypeName, paramFlags, scope)
7171

7272
// NOTE: Ideally we would write `parentConstrs: => Type*` but SIP-24 is only
7373
// implemented in Dotty and not in Scala 2.

compiler/src/dotty/tools/dotc/core/NameKinds.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,6 @@ object NameKinds {
358358
override def mkString(underlying: TermName, info: ThisInfo) = underlying.toString
359359
}
360360
val ExtMethName = new SuffixNameKind(EXTMETH, "$extension")
361-
val ModuleVarName = new SuffixNameKind(OBJECTVAR, "$module")
362361
val ModuleClassName = new SuffixNameKind(OBJECTCLASS, "$", optInfoString = "ModuleClass")
363362
val ImplMethName = new SuffixNameKind(IMPLMETH, "$")
364363
val AdaptedClosureName = new SuffixNameKind(ADAPTEDCLOSURE, "$adapted") { override def definesNewName = true }

compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ class ClassfileParser(
198198
var sym = classRoot.owner
199199
while (sym.isClass && !(sym is Flags.ModuleClass)) {
200200
for (tparam <- sym.typeParams) {
201-
classTParams = classTParams.updated(tparam.name.unexpandedName, tparam)
201+
classTParams = classTParams.updated(tparam.name, tparam)
202202
}
203203
sym = sym.owner
204204
}

compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -767,20 +767,9 @@ class TreeUnpickler(reader: TastyReader, nameAtRef: NameRef => TermName, posUnpi
767767
cls.setNoInitsFlags(fork.indexStats(end))
768768
val constr = readIndexedDef().asInstanceOf[DefDef]
769769

770-
def mergeTypeParamsAndAliases(tparams: List[TypeDef], stats: List[Tree])(implicit ctx: Context): (List[Tree], List[Tree]) =
771-
(tparams, stats) match {
772-
case (tparam :: tparams1, (alias: TypeDef) :: stats1)
773-
if tparam.name == alias.name.expandedName(cls) =>
774-
val (tas, stats2) = mergeTypeParamsAndAliases(tparams1, stats1)
775-
(tparam :: alias :: tas, stats2)
776-
case _ =>
777-
(tparams, stats)
778-
}
779-
780770
val lazyStats = readLater(end, rdr => implicit ctx => {
781-
val stats0 = rdr.readIndexedStats(localDummy, end)
782-
val (tparamsAndAliases, stats) = mergeTypeParamsAndAliases(tparams, stats0)
783-
tparamsAndAliases ++ vparams ++ stats
771+
val stats = rdr.readIndexedStats(localDummy, end)
772+
tparams ++ vparams ++ stats
784773
})
785774
setPos(start,
786775
untpd.Template(constr, parents, self, lazyStats)

compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
661661
if (tree.exists(!_.isEmpty)) encl(blockText(tree)) else ""
662662

663663
override protected def ParamRefNameString(name: Name): String =
664-
name.unexpandedName.invariantName.toString
664+
name.invariantName.toString
665665

666666
override protected def treatAsTypeParam(sym: Symbol): Boolean = sym is TypeParam
667667

compiler/src/dotty/tools/dotc/transform/FullParameterization.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ trait FullParameterization {
9898
case _ => (0, info)
9999
}
100100
val ctparams = if (abstractOverClass) clazz.typeParams else Nil
101-
val ctnames = ctparams.map(_.name.unexpandedName)
101+
val ctnames = ctparams.map(_.name)
102102
val ctvariances = ctparams.map(_.variance)
103103

104104
/** The method result type */

0 commit comments

Comments
 (0)