aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/typer/FrontEnd.scala
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/src/dotty/tools/dotc/typer/FrontEnd.scala')
-rw-r--r--compiler/src/dotty/tools/dotc/typer/FrontEnd.scala16
1 files changed, 15 insertions, 1 deletions
diff --git a/compiler/src/dotty/tools/dotc/typer/FrontEnd.scala b/compiler/src/dotty/tools/dotc/typer/FrontEnd.scala
index cd374e32c..90ffbcdae 100644
--- a/compiler/src/dotty/tools/dotc/typer/FrontEnd.scala
+++ b/compiler/src/dotty/tools/dotc/typer/FrontEnd.scala
@@ -19,6 +19,15 @@ class FrontEnd extends Phase {
override def isTyper = true
import ast.tpd
+ /** The contexts for compilation units that are parsed but not yet entered */
+ private var remaining: List[Context] = Nil
+
+ /** Does a source file ending with `<name>.scala` belong to a compilation unit
+ * that is parsed but not yet entered?
+ */
+ def stillToBeEntered(name: String): Boolean =
+ remaining.exists(_.compilationUnit.toString.endsWith(name + ".scala"))
+
def monitor(doing: String)(body: => Unit)(implicit ctx: Context) =
try body
catch {
@@ -75,7 +84,12 @@ class FrontEnd extends Phase {
}
unitContexts foreach (parse(_))
record("parsedTrees", ast.Trees.ntrees)
- unitContexts.foreach(enterSyms(_))
+ unitContexts.foreach(ctx => println(ctx.compilationUnit))
+ remaining = unitContexts
+ while (remaining.nonEmpty) {
+ enterSyms(remaining.head)
+ remaining = remaining.tail
+ }
unitContexts.foreach(enterAnnotations(_))
unitContexts.foreach(typeCheck(_))
record("total trees after typer", ast.Trees.ntrees)