summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@epfl.ch>2013-01-29 13:53:30 +0100
committerLukas Rytz <lukas.rytz@epfl.ch>2013-02-03 21:08:34 +0100
commit7e836f83e2930755f5d6b896a140909eb686289d (patch)
treec4e8d2b0b5a8452a6fcda8bca5f0451e08778735 /src/compiler/scala/tools/nsc/typechecker/Contexts.scala
parentb74c33eb860622e3630949ee0eeac9c15e8df166 (diff)
downloadscala-7e836f83e2930755f5d6b896a140909eb686289d.tar.gz
scala-7e836f83e2930755f5d6b896a140909eb686289d.tar.bz2
scala-7e836f83e2930755f5d6b896a140909eb686289d.zip
Analyzer Plugins
AnnotationCheckers are insufficient because they live outside the compiler cake and it's not possible to pass a Typer into an annotation checker. Analyzer plugins hook into important places of the compiler: - when the namer assigns a type to a symbol (plus a special hook for accessors) - before typing a tree, to modify the expected type - after typing a tree, to modify the type assigned to the tree Analyzer plugins and annotation checker can be activated only during selected phases of the compiler. Refactored the CPS plugin to use an analyzer plugin (since adaptToAnnotations is now part of analyzer plugins, no longer annotation checkers).
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Contexts.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Contexts.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
index 579eacb08d..620665126e 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
@@ -35,7 +35,7 @@ trait Contexts { self: Analyzer =>
val completeList = JavaLangPackage :: ScalaPackage :: PredefModule :: Nil
}
- private val startContext = {
+ private lazy val startContext = {
NoContext.make(
Template(List(), emptyValDef, List()) setSymbol global.NoSymbol setType global.NoType,
rootMirror.RootClass,