Skip to content

Commit ac8f816

Browse files
Merge pull request #4263 from dotty-staging/cleanups
Small cleanups
2 parents e0ef928 + e4670f4 commit ac8f816

File tree

5 files changed

+1
-20
lines changed

5 files changed

+1
-20
lines changed

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -382,10 +382,6 @@ object Phases {
382382
override def toString = phaseName
383383
}
384384

385-
trait NeedsCompanions {
386-
def isCompanionNeeded(cls: ClassSymbol)(implicit ctx: Context): Boolean
387-
}
388-
389385
/** Replace all instances of `oldPhaseClass` in `current` phases
390386
* by the result of `newPhases` applied to the old phase.
391387
*/

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import dotty.tools.dotc.ast.{Trees, tpd}
1111
import scala.collection.{ mutable, immutable }
1212
import mutable.ListBuffer
1313
import core._
14-
import dotty.tools.dotc.core.Phases.{NeedsCompanions, Phase}
14+
import dotty.tools.dotc.core.Phases.Phase
1515
import Types._, Contexts._, Constants._, Names._, NameOps._, Flags._, DenotTransformers._
1616
import SymDenotations._, Symbols._, StdNames._, Annotations._, Trees._, Scopes._, Denotations._
1717
import TypeErasure.{ valueErasure, ErasedValueType }

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

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ package transform
44
import core._
55
import Names._
66
import dotty.tools.dotc.ast.tpd
7-
import dotty.tools.dotc.core.Phases.NeedsCompanions
87
import dotty.tools.dotc.transform.MegaPhase._
98
import ast.Trees._
109
import ast.untpd
@@ -30,7 +29,6 @@ object FirstTransform {
3029

3130

3231
/** The first tree transform
33-
* - ensures there are companion objects for all classes except module classes
3432
* - eliminates some kinds of trees: Imports, NamedArgs
3533
* - stubs out native methods
3634
* - eliminates self tree in Template and self symbol in ClassInfo
@@ -45,18 +43,6 @@ class FirstTransform extends MiniPhase with InfoTransformer { thisPhase =>
4543

4644
override def phaseName = FirstTransform.name
4745

48-
private[this] var addCompanionPhases: List[NeedsCompanions] = _
49-
50-
override def changesMembers = true // the phase adds companion objects
51-
52-
def needsCompanion(cls: ClassSymbol)(implicit ctx: Context) =
53-
addCompanionPhases.exists(_.isCompanionNeeded(cls))
54-
55-
override def prepareForUnit(tree: Tree)(implicit ctx: Context) = {
56-
addCompanionPhases = ctx.phasePlan.flatMap(_ collect { case p: NeedsCompanions => p })
57-
ctx
58-
}
59-
6046
/** eliminate self symbol in ClassInfo */
6147
override def transformInfo(tp: Type, sym: Symbol)(implicit ctx: Context): Type = tp match {
6248
case tp @ ClassInfo(_, _, _, _, self: Symbol) =>

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package dotty.tools.dotc
22
package transform
33

44
import dotty.tools.dotc.core.Annotations.Annotation
5-
import dotty.tools.dotc.core.Phases.NeedsCompanions
65

76
import scala.collection.mutable
87
import core._

0 commit comments

Comments
 (0)