Skip to content

Commit fee9e8f

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 514a0f2 commit fee9e8f

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
@@ -197,7 +197,7 @@ class ClassfileParser(
197197
var sym = classRoot.owner
198198
while (sym.isClass && !(sym is Flags.ModuleClass)) {
199199
for (tparam <- sym.typeParams) {
200-
classTParams = classTParams.updated(tparam.name.unexpandedName, tparam)
200+
classTParams = classTParams.updated(tparam.name, tparam)
201201
}
202202
sym = sym.owner
203203
}

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

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

764-
def mergeTypeParamsAndAliases(tparams: List[TypeDef], stats: List[Tree])(implicit ctx: Context): (List[Tree], List[Tree]) =
765-
(tparams, stats) match {
766-
case (tparam :: tparams1, (alias: TypeDef) :: stats1)
767-
if tparam.name == alias.name.expandedName(cls) =>
768-
val (tas, stats2) = mergeTypeParamsAndAliases(tparams1, stats1)
769-
(tparam :: alias :: tas, stats2)
770-
case _ =>
771-
(tparams, stats)
772-
}
773-
774764
val lazyStats = readLater(end, rdr => implicit ctx => {
775-
val stats0 = rdr.readIndexedStats(localDummy, end)
776-
val (tparamsAndAliases, stats) = mergeTypeParamsAndAliases(tparams, stats0)
777-
tparamsAndAliases ++ vparams ++ stats
765+
val stats = rdr.readIndexedStats(localDummy, end)
766+
tparams ++ vparams ++ stats
778767
})
779768
setPos(start,
780769
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
@@ -655,7 +655,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
655655
if (tree.exists(!_.isEmpty)) encl(blockText(tree)) else ""
656656

657657
override protected def ParamRefNameString(name: Name): String =
658-
name.unexpandedName.invariantName.toString
658+
name.invariantName.toString
659659

660660
override protected def treatAsTypeParam(sym: Symbol): Boolean = sym is TypeParam
661661

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)