diff options
Diffstat (limited to 'tests/untried/neg/t7494-right-after-terminal')
4 files changed, 44 insertions, 0 deletions
diff --git a/tests/untried/neg/t7494-right-after-terminal/ThePlugin.scala b/tests/untried/neg/t7494-right-after-terminal/ThePlugin.scala new file mode 100644 index 000000000..7c4d08458 --- /dev/null +++ b/tests/untried/neg/t7494-right-after-terminal/ThePlugin.scala @@ -0,0 +1,32 @@ +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 = "rightafterterminal" + val description = "Declares one plugin that wants to be right after the terminal phase" + val components = List[PluginComponent](thePhase) + + private object thePhase extends PluginComponent { + val global = ThePlugin.this.global + + val runsAfter = List[String]() + override val runsRightAfter = Some("terminal") + + val phaseName = ThePlugin.this.name + + def newPhase(prev: Phase) = new ThePhase(prev) + } + + private class ThePhase(prev: Phase) extends Phase(prev) { + def name = ThePlugin.this.name + def run: Unit = {} + } +} + diff --git a/tests/untried/neg/t7494-right-after-terminal/sample_2.flags b/tests/untried/neg/t7494-right-after-terminal/sample_2.flags new file mode 100644 index 000000000..da046ba5f --- /dev/null +++ b/tests/untried/neg/t7494-right-after-terminal/sample_2.flags @@ -0,0 +1 @@ +-Xplugin:. -Xplugin-require:rightafterterminal diff --git a/tests/untried/neg/t7494-right-after-terminal/sample_2.scala b/tests/untried/neg/t7494-right-after-terminal/sample_2.scala new file mode 100644 index 000000000..73cdc64e4 --- /dev/null +++ b/tests/untried/neg/t7494-right-after-terminal/sample_2.scala @@ -0,0 +1,6 @@ + +package sample + +// just a sample that is compiled with the sample plugin enabled +object Sample extends App { +} diff --git a/tests/untried/neg/t7494-right-after-terminal/scalac-plugin.xml b/tests/untried/neg/t7494-right-after-terminal/scalac-plugin.xml new file mode 100644 index 000000000..2558d6fd0 --- /dev/null +++ b/tests/untried/neg/t7494-right-after-terminal/scalac-plugin.xml @@ -0,0 +1,5 @@ +<plugin> + <name>ignored</name> + <classname>scala.test.plugins.ThePlugin</classname> +</plugin> + |