summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSom Snytt <som.snytt@gmail.com>2014-05-24 01:31:20 -0700
committerSom Snytt <som.snytt@gmail.com>2014-07-08 21:28:35 -0700
commit91670d91824493e8bbbd88e9861e04e710311cbb (patch)
treecc9d37302538701b8e394dcec97c9194ae15fa31 /src
parent2103dbc5230ddf2a369389f179f4ef70eae344f2 (diff)
downloadscala-91670d91824493e8bbbd88e9861e04e710311cbb.tar.gz
scala-91670d91824493e8bbbd88e9861e04e710311cbb.tar.bz2
scala-91670d91824493e8bbbd88e9861e04e710311cbb.zip
SI-8616 Error on -deprecation:true,false
This is an error, not a crash. Alternatively, one could define the multivalued colon case as equivalent to specifying the option multiple times. That would be very regular. But sometimes it's nicer just to error out.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/settings/MutableSettings.scala5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/settings/MutableSettings.scala b/src/compiler/scala/tools/nsc/settings/MutableSettings.scala
index 5b5c80c514..b399c0e024 100644
--- a/src/compiler/scala/tools/nsc/settings/MutableSettings.scala
+++ b/src/compiler/scala/tools/nsc/settings/MutableSettings.scala
@@ -444,7 +444,7 @@ class MutableSettings(val errorFn: String => Unit)
value = s.equalsIgnoreCase("true")
}
override def tryToSetColon(args: List[String]) = args match {
- case Nil => tryToSet(Nil)
+ case Nil => tryToSet(Nil)
case List(x) =>
if (x.equalsIgnoreCase("true")) {
value = true
@@ -452,7 +452,8 @@ class MutableSettings(val errorFn: String => Unit)
} else if (x.equalsIgnoreCase("false")) {
value = false
Some(Nil)
- } else errorAndValue("'" + x + "' is not a valid choice for '" + name + "'", None)
+ } else errorAndValue(s"'$x' is not a valid choice for '$name'", None)
+ case _ => errorAndValue(s"'$name' accepts only one boolean value", None)
}
}