diff options
author | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2013-09-12 10:26:46 -0700 |
---|---|---|
committer | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2013-09-12 10:26:46 -0700 |
commit | 33a819f61b8b9c19708e8ae22bf25adf6cc7ac24 (patch) | |
tree | 30fb8d7295f359aca662eb3fb96bc9f9a0646f1f /test/files/neg/t7622-cyclic-dependency/ThePlugin.scala | |
parent | e748f2ed8fda553fd8fe36499bac63aa115a82a9 (diff) | |
parent | dfe3fe335bf7358e04e7f422fecf16f445c14f2b (diff) | |
download | scala-33a819f61b8b9c19708e8ae22bf25adf6cc7ac24.tar.gz scala-33a819f61b8b9c19708e8ae22bf25adf6cc7ac24.tar.bz2 scala-33a819f61b8b9c19708e8ae22bf25adf6cc7ac24.zip |
Merge pull request #2859 from som-snytt/issue/7622-phaser
SI-7622 Clean Up Phase Assembly
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 {} + } +} + |