Skip to content

Commit b8ffaf8

Browse files
committed
Merge pull request #467 from dotty-staging/drop/invalidateCompanions
Drop the invalidate undefined companions code in restoreScopes
2 parents 957923e + a1b7e46 commit b8ffaf8

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

src/dotty/tools/dotc/transform/RestoreScopes.scala

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,6 @@ class RestoreScopes extends MiniPhaseTransform with IdentityDenotTransformer { t
2222
import ast.tpd._
2323
override def phaseName = "restoreScopes"
2424

25-
private def invalidateUndefinedCompanions(pkg: ClassSymbol, cls: ClassSymbol)(implicit ctx: Context): Unit = {
26-
val otherNames =
27-
if (cls is Flags.Module)
28-
List(cls.name.sourceModuleName, cls.name.stripModuleClassSuffix.toTypeName)
29-
else
30-
List(cls.name.toTermName, cls.name.moduleClassName)
31-
for (otherName <- otherNames) {
32-
val other = pkg.info.decl(otherName).asSymDenotation
33-
if (other.exists && !other.isCompleted) other.markAbsent
34-
}
35-
}
36-
3725
override def transformTypeDef(tree: TypeDef)(implicit ctx: Context, info: TransformerInfo) = {
3826
val TypeDef(_, impl: Template) = tree
3927
//
@@ -46,8 +34,6 @@ class RestoreScopes extends MiniPhaseTransform with IdentityDenotTransformer { t
4634
val cls = tree.symbol.asClass
4735
val pkg = cls.owner.asClass
4836
pkg.enter(cls)
49-
invalidateUndefinedCompanions(pkg, cls)(
50-
ctx.withPhase(cls.initial.validFor.phaseId).addMode(Mode.FutureDefsOK))
5137
val cinfo = cls.classInfo
5238
tree.symbol.copySymDenotation(
5339
info = cinfo.derivedClassInfo( // Dotty deviation: Cannot expand cinfo inline without a type error

0 commit comments

Comments
 (0)