diff options
author | Som Snytt <som.snytt@gmail.com> | 2013-07-25 12:58:56 -0700 |
---|---|---|
committer | Som Snytt <som.snytt@gmail.com> | 2013-08-21 18:02:35 -0700 |
commit | 1683c95e159006d40a8458d29ef266ca741752c7 (patch) | |
tree | 69d40c95510159340ed3e660f0809f1bfef97ed7 /test/files/neg/t7622-cyclic-dependency/ThePlugin.scala | |
parent | f3731f9ace5d3d5e213ea786fe0027ea66c5358b (diff) | |
download | scala-1683c95e159006d40a8458d29ef266ca741752c7.tar.gz scala-1683c95e159006d40a8458d29ef266ca741752c7.tar.bz2 scala-1683c95e159006d40a8458d29ef266ca741752c7.zip |
SI-7622 Clean Up Phase Assembly
Let optimiser components and continuations plugin opt-out
when required flags are not set.
Wasted time on a whitespace error in check file, so let
--debug dump the processed check file and its diff.
Diffstat (limited to 'test/files/neg/t7622-cyclic-dependency/ThePlugin.scala')
-rw-r--r-- | test/files/neg/t7622-cyclic-dependency/ThePlugin.scala | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/test/files/neg/t7622-cyclic-dependency/ThePlugin.scala b/test/files/neg/t7622-cyclic-dependency/ThePlugin.scala new file mode 100644 index 0000000000..7a905ae32d --- /dev/null +++ b/test/files/neg/t7622-cyclic-dependency/ThePlugin.scala @@ -0,0 +1,40 @@ +package scala.test.plugins + +import scala.tools.nsc +import nsc.Global +import nsc.Phase +import nsc.plugins.Plugin +import nsc.plugins.PluginComponent + +class ThePlugin(val global: Global) extends Plugin { + import global._ + + val name = "cyclicdependency" + val description = "Declares two phases that have a cyclic dependency" + val components = List[PluginComponent](thePhase1,thePhase2) + + private object thePhase1 extends PluginComponent { + val global = ThePlugin.this.global + + val runsAfter = List[String]("tailcalls","cyclicdependency2") + + val phaseName = ThePlugin.this.name + "1" + + def newPhase(prev: Phase) = new ThePhase(prev, phaseName) + } + + private object thePhase2 extends PluginComponent { + val global = ThePlugin.this.global + + val runsAfter = List[String]("dce","cyclicdependency1") + + val phaseName = ThePlugin.this.name + "2" + + def newPhase(prev: Phase) = new ThePhase(prev, phaseName) + } + + private class ThePhase(prev: Phase, val name: String) extends Phase(prev) { + def run {} + } +} + |