aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Typer.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-06-14 18:50:23 +0200
committerMartin Odersky <odersky@gmail.com>2015-06-19 12:03:38 +0200
commitd70d184d793971a598452b02ea3ab87e3ff4cf03 (patch)
tree5057f09631f73985f0d0f2cb8af5e0bc00391568 /src/dotty/tools/dotc/typer/Typer.scala
parent0a504655329dc01a0dc91b847de7ac2b1a688692 (diff)
downloaddotty-d70d184d793971a598452b02ea3ab87e3ff4cf03.tar.gz
dotty-d70d184d793971a598452b02ea3ab87e3ff4cf03.tar.bz2
dotty-d70d184d793971a598452b02ea3ab87e3ff4cf03.zip
Evaluate annotations in Namer
Annotations were evaluated in Typer, which meant that they could be used only after type checking was complete (or compilation order dependencies would be introduced). This commit makes annotations be installed as part of completion in Namer. However, annotations are now lazy so as to avoid cyclic references. This is completely analogous to the scheme in unpickler and ClassfileParser.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Typer.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala
index 5f03d19e7..db3ae9319 100644
--- a/src/dotty/tools/dotc/typer/Typer.scala
+++ b/src/dotty/tools/dotc/typer/Typer.scala
@@ -861,7 +861,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
def addTypedModifiersAnnotations(mdef: untpd.MemberDef, sym: Symbol)(implicit ctx: Context): Unit = {
val mods1 = typedModifiers(untpd.modsDeco(mdef).mods, sym)
- for (tree <- mods1.annotations) sym.addAnnotation(Annotation(tree))
+ sym.annotations.foreach(_.tree) // force trees to be computed
}
def typedModifiers(mods: untpd.Modifiers, sym: Symbol)(implicit ctx: Context): Modifiers = track("typedModifiers") {