From 9ef5f6817688f814a3450126aa7383b0928e80a0 Mon Sep 17 00:00:00 2001 From: Samuel Gruetter Date: Wed, 12 Mar 2014 22:44:33 +0100 Subject: add tests from scala/test/files/{pos,neg} with explicit Unit return type --- .../neg/t7494-before-parser/ThePlugin.scala | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 tests/untried/neg/t7494-before-parser/ThePlugin.scala (limited to 'tests/untried/neg/t7494-before-parser/ThePlugin.scala') diff --git a/tests/untried/neg/t7494-before-parser/ThePlugin.scala b/tests/untried/neg/t7494-before-parser/ThePlugin.scala new file mode 100644 index 000000000..bb335c9c9 --- /dev/null +++ b/tests/untried/neg/t7494-before-parser/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 = "beforeparser" + val description = "Declares one plugin that wants to be before the parser phase" + val components = List[PluginComponent](thePhase) + + private object thePhase extends PluginComponent { + val global = ThePlugin.this.global + + val runsAfter = List[String]() + override val runsBefore = List[String]("parser") + + 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 = {} + } +} + -- cgit v1.2.3