summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2013-07-12 11:55:56 -0700
committerAdriaan Moors <adriaan.moors@typesafe.com>2013-07-12 11:55:56 -0700
commit465b874df307848fca21e085ae32f28367699386 (patch)
tree720314d9db65a6749556d5e4ea0a536c8e4edc99
parent03e4ae59b6b92f128ed3f06c8aa318eb89d61dae (diff)
parent415dda408d6bee761a6249a4a9578e6f50527a83 (diff)
downloadscala-465b874df307848fca21e085ae32f28367699386.tar.gz
scala-465b874df307848fca21e085ae32f28367699386.tar.bz2
scala-465b874df307848fca21e085ae32f28367699386.zip
Merge pull request #2708 from soc/SI-7174
SI-7174 Fix initialization issues
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Analyzer.scala11
-rw-r--r--src/continuations/plugin/scala/tools/selectivecps/SelectiveCPSPlugin.scala10
2 files changed, 10 insertions, 11 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Analyzer.scala b/src/compiler/scala/tools/nsc/typechecker/Analyzer.scala
index 02e1eb6f00..5c02516c47 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Analyzer.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Analyzer.scala
@@ -29,8 +29,9 @@ trait Analyzer extends AnyRef
val global : Global
import global._
- object namerFactory extends SubComponent {
+ object namerFactory extends {
val global: Analyzer.this.global.type = Analyzer.this.global
+ } with SubComponent {
val phaseName = "namer"
val runsAfter = List[String]("parser")
val runsRightAfter = None
@@ -44,8 +45,9 @@ trait Analyzer extends AnyRef
}
}
- object packageObjects extends SubComponent {
+ object packageObjects extends {
val global: Analyzer.this.global.type = Analyzer.this.global
+ } with SubComponent {
val phaseName = "packageobjects"
val runsAfter = List[String]()
val runsRightAfter= Some("namer")
@@ -71,9 +73,10 @@ trait Analyzer extends AnyRef
}
}
- object typerFactory extends SubComponent {
- import scala.reflect.internal.TypesStats.typerNanos
+ object typerFactory extends {
val global: Analyzer.this.global.type = Analyzer.this.global
+ } with SubComponent {
+ import scala.reflect.internal.TypesStats.typerNanos
val phaseName = "typer"
val runsAfter = List[String]()
val runsRightAfter = Some("packageobjects")
diff --git a/src/continuations/plugin/scala/tools/selectivecps/SelectiveCPSPlugin.scala b/src/continuations/plugin/scala/tools/selectivecps/SelectiveCPSPlugin.scala
index c16cce2f2c..d3b02d74f4 100644
--- a/src/continuations/plugin/scala/tools/selectivecps/SelectiveCPSPlugin.scala
+++ b/src/continuations/plugin/scala/tools/selectivecps/SelectiveCPSPlugin.scala
@@ -11,22 +11,18 @@ class SelectiveCPSPlugin(val global: Global) extends Plugin {
val name = "continuations"
val description = "applies selective cps conversion"
- val anfPhase = new SelectiveANFTransform() {
- val global = SelectiveCPSPlugin.this.global
+ val anfPhase = new {val global = SelectiveCPSPlugin.this.global } with SelectiveANFTransform() {
val runsAfter = List("pickler")
}
- val cpsPhase = new SelectiveCPSTransform() {
- val global = SelectiveCPSPlugin.this.global
+ val cpsPhase = new {val global = SelectiveCPSPlugin.this.global } with SelectiveCPSTransform() {
val runsAfter = List("selectiveanf")
override val runsBefore = List("uncurry")
}
val components = List[PluginComponent](anfPhase, cpsPhase)
- val checker = new CPSAnnotationChecker {
- val global: SelectiveCPSPlugin.this.global.type = SelectiveCPSPlugin.this.global
- }
+ val checker = new { val global: SelectiveCPSPlugin.this.global.type = SelectiveCPSPlugin.this.global } with CPSAnnotationChecker
global.addAnnotationChecker(checker.checker)
global.analyzer.addAnalyzerPlugin(checker.plugin)