Skip to content

Commit 986ad10

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 4f1b3b3 commit 986ad10

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
@@ -763,20 +763,9 @@ class TreeUnpickler(reader: TastyReader, nameAtRef: NameRef => TermName, posUnpi
763763
cls.setNoInitsFlags(fork.indexStats(end))
764764
val constr = readIndexedDef().asInstanceOf[DefDef]
765765

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

658658
override protected def ParamRefNameString(name: Name): String =
659-
name.unexpandedName.invariantName.toString
659+
name.invariantName.toString
660660

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

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)