aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/typer/FrontEnd.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-12-21 12:11:42 +0100
committerMartin Odersky <odersky@gmail.com>2016-12-21 12:11:42 +0100
commitec35b840e71c34ea2d7c7a59a9c69ce0f44c4740 (patch)
treee99e65055b9612245540a4315ea13a958ae9efcf /compiler/src/dotty/tools/dotc/typer/FrontEnd.scala
parentcf4f773840ba3955b2907b04208b378d22d37651 (diff)
downloaddotty-ec35b840e71c34ea2d7c7a59a9c69ce0f44c4740.tar.gz
dotty-ec35b840e71c34ea2d7c7a59a9c69ce0f44c4740.tar.bz2
dotty-ec35b840e71c34ea2d7c7a59a9c69ce0f44c4740.zip
Tweak the way annotations are represented in desugaring
Need to be careful not to read a classfile before a compilation unit defining the annotation is entered.
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)