aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-03-08 16:18:33 +0100
committerMartin Odersky <odersky@gmail.com>2013-03-08 16:18:33 +0100
commit00578454211f8cb779018347b5964c08b292e170 (patch)
tree04d52d57940eb13bda2b2308c6e54094347432f4 /src
parent0ffc6d29fe325597ab8d9cfc8708b30d5f085685 (diff)
downloaddotty-00578454211f8cb779018347b5964c08b292e170.tar.gz
dotty-00578454211f8cb779018347b5964c08b292e170.tar.bz2
dotty-00578454211f8cb779018347b5964c08b292e170.zip
A fix in settings caused by a probably Scala 2.10 bug
Diffstat (limited to 'src')
-rw-r--r--src/dotty/tools/dotc/config/Settings.scala7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/config/Settings.scala b/src/dotty/tools/dotc/config/Settings.scala
index 1f96be342..e8cbaa4ec 100644
--- a/src/dotty/tools/dotc/config/Settings.scala
+++ b/src/dotty/tools/dotc/config/Settings.scala
@@ -63,7 +63,12 @@ object Settings {
def updateIn(state: SettingsState, x: Any): SettingsState = x match {
case _: T => state.update(idx, x)
- case _ => throw new ClassCastException("illegal argument")
+ case _ =>
+ // would like to do:
+ // throw new ClassCastException(s"illegal argument, found: $x of type ${x.getClass}, required: ${implicitly[ClassTag[T]]}")
+ // but this runs afoul of primitive types. Concretely: if T is Boolean, then x is a boxed Boolean and the test will fail.
+ // Maybe this is a bug in Scala 2.10?
+ state.update(idx, x.asInstanceOf[T])
}
def isDefaultIn(state: SettingsState) = valueIn(state) == default