summaryrefslogtreecommitdiff
path: root/test/files/neg/t7622-multi-followers
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/neg/t7622-multi-followers')
-rw-r--r--test/files/neg/t7622-multi-followers/ThePlugin.scala44
-rw-r--r--test/files/neg/t7622-multi-followers/sample_2.flags1
-rw-r--r--test/files/neg/t7622-multi-followers/sample_2.scala6
-rw-r--r--test/files/neg/t7622-multi-followers/scalac-plugin.xml5
4 files changed, 56 insertions, 0 deletions
diff --git a/test/files/neg/t7622-multi-followers/ThePlugin.scala b/test/files/neg/t7622-multi-followers/ThePlugin.scala
new file mode 100644
index 0000000000..e7a49a9be6
--- /dev/null
+++ b/test/files/neg/t7622-multi-followers/ThePlugin.scala
@@ -0,0 +1,44 @@
+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 = "multi"
+ val description = "Declares two phases that both follow parser"
+ val components = List[PluginComponent](thePhase1,thePhase2)
+
+ private object thePhase1 extends PluginComponent {
+ val global = ThePlugin.this.global
+
+ val runsAfter = List[String]()
+
+ override val runsRightAfter = Some("parser")
+
+ 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]()
+
+ override val runsRightAfter = Some("parser")
+
+ 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 {}
+ }
+}
+
diff --git a/test/files/neg/t7622-multi-followers/sample_2.flags b/test/files/neg/t7622-multi-followers/sample_2.flags
new file mode 100644
index 0000000000..d2e83e9723
--- /dev/null
+++ b/test/files/neg/t7622-multi-followers/sample_2.flags
@@ -0,0 +1 @@
+-Xplugin:. -Xplugin-require:multi
diff --git a/test/files/neg/t7622-multi-followers/sample_2.scala b/test/files/neg/t7622-multi-followers/sample_2.scala
new file mode 100644
index 0000000000..73cdc64e40
--- /dev/null
+++ b/test/files/neg/t7622-multi-followers/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/test/files/neg/t7622-multi-followers/scalac-plugin.xml b/test/files/neg/t7622-multi-followers/scalac-plugin.xml
new file mode 100644
index 0000000000..2558d6fd03
--- /dev/null
+++ b/test/files/neg/t7622-multi-followers/scalac-plugin.xml
@@ -0,0 +1,5 @@
+<plugin>
+ <name>ignored</name>
+ <classname>scala.test.plugins.ThePlugin</classname>
+</plugin>
+