@@ -31,15 +31,6 @@ class TyperPhase(addRootImports: Boolean = true) extends Phase {
31
31
32
32
override def allowsImplicitSearch : Boolean = true
33
33
34
- /** The contexts for compilation units that are parsed but not yet entered */
35
- private var remaining : List [Context ] = Nil
36
-
37
- /** Does a source file ending with `<name>.scala` belong to a compilation unit
38
- * that is parsed but not yet entered?
39
- */
40
- def stillToBeEntered (name : String ): Boolean =
41
- remaining.exists(_.compilationUnit.toString.endsWith(name + " .scala" ))
42
-
43
34
// Run regardless of parsing errors
44
35
override def isRunnable (implicit ctx : Context ): Boolean = true
45
36
@@ -68,13 +59,6 @@ class TyperPhase(addRootImports: Boolean = true) extends Phase {
68
59
JavaChecks .check(unit.tpdTree)
69
60
}
70
61
71
-
72
- private def firstTopLevelDef (trees : List [tpd.Tree ])(using Context ): Symbol = trees match
73
- case PackageDef (_, defs) :: _ => firstTopLevelDef(defs)
74
- case Import (_, _) :: defs => firstTopLevelDef(defs)
75
- case (tree @ TypeDef (_, _)) :: _ => tree.symbol
76
- case _ => NoSymbol
77
-
78
62
protected def discardAfterTyper (unit : CompilationUnit )(using Context ): Boolean =
79
63
unit.isJava || unit.suspended
80
64
@@ -89,11 +73,9 @@ class TyperPhase(addRootImports: Boolean = true) extends Phase {
89
73
else
90
74
newCtx
91
75
92
- remaining = unitContexts
93
- while remaining.nonEmpty do
94
- enterSyms(using remaining.head)
95
- remaining = remaining.tail
96
- val firstXmlPos = ctx.base.parserPhase match {
76
+ unitContexts.foreach(enterSyms(using _))
77
+
78
+ ctx.base.parserPhase match {
97
79
case p : ParserPhase =>
98
80
if p.firstXmlPos.exists && ! defn.ScalaXmlPackageClass .exists then
99
81
report.error(
0 commit comments