diff options
author | Martin Odersky <odersky@gmail.com> | 2015-04-09 10:49:56 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-04-09 10:49:56 +0200 |
commit | a1b7e46b490fe3035d97add614e73af9a19e8276 (patch) | |
tree | 52686a755ab9ae7622ccf02ceabbcb772905cf35 /src | |
parent | 957923ec75c71ac9f7efe67823781438177aaa59 (diff) | |
download | dotty-a1b7e46b490fe3035d97add614e73af9a19e8276.tar.gz dotty-a1b7e46b490fe3035d97add614e73af9a19e8276.tar.bz2 dotty-a1b7e46b490fe3035d97add614e73af9a19e8276.zip |
Drop the invalidate undefined companions code in restoreScopes
It is no longer needed because companion classes are now tracked with
companion$ methods. It also causes unncessary inner classes reads.
Diffstat (limited to 'src')
-rw-r--r-- | src/dotty/tools/dotc/transform/RestoreScopes.scala | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/src/dotty/tools/dotc/transform/RestoreScopes.scala b/src/dotty/tools/dotc/transform/RestoreScopes.scala index 7c84e8749..0eb1935a6 100644 --- a/src/dotty/tools/dotc/transform/RestoreScopes.scala +++ b/src/dotty/tools/dotc/transform/RestoreScopes.scala @@ -22,18 +22,6 @@ class RestoreScopes extends MiniPhaseTransform with IdentityDenotTransformer { t import ast.tpd._ override def phaseName = "restoreScopes" - private def invalidateUndefinedCompanions(pkg: ClassSymbol, cls: ClassSymbol)(implicit ctx: Context): Unit = { - val otherNames = - if (cls is Flags.Module) - List(cls.name.sourceModuleName, cls.name.stripModuleClassSuffix.toTypeName) - else - List(cls.name.toTermName, cls.name.moduleClassName) - for (otherName <- otherNames) { - val other = pkg.info.decl(otherName).asSymDenotation - if (other.exists && !other.isCompleted) other.markAbsent - } - } - override def transformTypeDef(tree: TypeDef)(implicit ctx: Context, info: TransformerInfo) = { val TypeDef(_, impl: Template) = tree // @@ -46,8 +34,6 @@ class RestoreScopes extends MiniPhaseTransform with IdentityDenotTransformer { t val cls = tree.symbol.asClass val pkg = cls.owner.asClass pkg.enter(cls) - invalidateUndefinedCompanions(pkg, cls)( - ctx.withPhase(cls.initial.validFor.phaseId).addMode(Mode.FutureDefsOK)) val cinfo = cls.classInfo tree.symbol.copySymDenotation( info = cinfo.derivedClassInfo( // Dotty deviation: Cannot expand cinfo inline without a type error |