summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/plugins
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2015-04-08 19:35:52 +1000
committerJason Zaugg <jzaugg@gmail.com>2015-04-08 22:10:11 +1000
commitbb9bce7587855155ee29b93057bd763cfa4c76a6 (patch)
treee90247087396cd33cde5023bd3e3201180dcd9c5 /src/compiler/scala/tools/nsc/plugins
parent214d79841970be29bac126eb48f955c8f082e1bc (diff)
downloadscala-bb9bce7587855155ee29b93057bd763cfa4c76a6.tar.gz
scala-bb9bce7587855155ee29b93057bd763cfa4c76a6.tar.bz2
scala-bb9bce7587855155ee29b93057bd763cfa4c76a6.zip
Fix regression in plugin API
Removing a call to a deprecated method had the effect of rendering plugins that override that method inoperable. This manifest as a failure to build scala-js in the community build: https://github.com/scala/community-builds/issues/95 Partially reverts d4546fd.
Diffstat (limited to 'src/compiler/scala/tools/nsc/plugins')
-rw-r--r--src/compiler/scala/tools/nsc/plugins/Plugin.scala6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/plugins/Plugin.scala b/src/compiler/scala/tools/nsc/plugins/Plugin.scala
index 5a7a0df595..1a5529140c 100644
--- a/src/compiler/scala/tools/nsc/plugins/Plugin.scala
+++ b/src/compiler/scala/tools/nsc/plugins/Plugin.scala
@@ -60,13 +60,15 @@ abstract class Plugin {
* @return true to continue, or false to opt out
*/
def init(options: List[String], error: String => Unit): Boolean = {
- if (!options.isEmpty) error(s"Error: $name takes no options")
+ // call to deprecated method required here, we must continue to support
+ // code that subclasses that override `processOptions`.
+ processOptions(options, error)
true
}
@deprecated("use Plugin#init instead", since="2.11")
def processOptions(options: List[String], error: String => Unit): Unit = {
- init(options, error)
+ if (!options.isEmpty) error(s"Error: $name takes no options")
}
/** A description of this plugin's options, suitable as a response