summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIulian Dragos <jaguarul@gmail.com>2012-04-30 11:46:33 +0200
committerIulian Dragos <jaguarul@gmail.com>2012-04-30 12:12:59 +0200
commit416abb70256267ccb80b7f5b6d205c9f384a14e0 (patch)
tree8899c35ca481b39f9825764cccd7b245ad5faac1
parent94c63f5da548996535cad43142758c9405118828 (diff)
downloadscala-416abb70256267ccb80b7f5b6d205c9f384a14e0.tar.gz
scala-416abb70256267ccb80b7f5b6d205c9f384a14e0.tar.bz2
scala-416abb70256267ccb80b7f5b6d205c9f384a14e0.zip
Fixed `Setting.enabling` to properly disable dependent settings when the original setting is set to `false`.
This can be witnessed in the IDE, when explicitly setting the `-optimize` flag to false leads to setting all the dependent flags to true (`-Yinline`, `-Ydce`, `-Ycloselim`).
-rw-r--r--src/compiler/scala/tools/nsc/settings/ScalaSettings.scala6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala b/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala
index 91e31cae97..0a9d25af7e 100644
--- a/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala
+++ b/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala
@@ -41,11 +41,11 @@ trait ScalaSettings extends AbsScalaSettings
protected def optimiseSettings = List[BooleanSetting](inline, inlineHandlers, Xcloselim, Xdce)
/** Internal use - syntax enhancements. */
- private class EnableSettings[T <: Setting](val s: T) {
- def enabling(toEnable: List[BooleanSetting]): s.type = s withPostSetHook (_ => toEnable foreach (_.value = true))
+ private class EnableSettings[T <: BooleanSetting](val s: T) {
+ def enabling(toEnable: List[BooleanSetting]): s.type = s withPostSetHook (_ => toEnable foreach (_.value = s.value))
def andThen(f: s.T => Unit): s.type = s withPostSetHook (setting => f(setting.value))
}
- private implicit def installEnableSettings[T <: Setting](s: T) = new EnableSettings(s)
+ private implicit def installEnableSettings[T <: BooleanSetting](s: T) = new EnableSettings(s)
/** Disable a setting */
def disable(s: Setting) = allSettings -= s