summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-07-11 23:01:51 +0000
committerPaul Phillips <paulp@improving.org>2011-07-11 23:01:51 +0000
commita10f699d7c443e83472e262ae77a3fe7d9cdc1ba (patch)
treeaa3e2915847359e0b3243d937736ce3cc60166cf /src
parente3085dadb3cbb1c416779ddec9d57f9467887a5a (diff)
downloadscala-a10f699d7c443e83472e262ae77a3fe7d9cdc1ba.tar.gz
scala-a10f699d7c443e83472e262ae77a3fe7d9cdc1ba.tar.bz2
scala-a10f699d7c443e83472e262ae77a3fe7d9cdc1ba.zip
Seeing about getting trunk building again, no r...
Seeing about getting trunk building again, no review.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/reflect/internal/settings/MutableSettings.scala4
-rw-r--r--src/compiler/scala/reflect/std/ReflectSettings.scala4
-rw-r--r--src/compiler/scala/tools/nsc/settings/MutableSettings.scala16
3 files changed, 12 insertions, 12 deletions
diff --git a/src/compiler/scala/reflect/internal/settings/MutableSettings.scala b/src/compiler/scala/reflect/internal/settings/MutableSettings.scala
index bd4a4bbd40..f74654efed 100644
--- a/src/compiler/scala/reflect/internal/settings/MutableSettings.scala
+++ b/src/compiler/scala/reflect/internal/settings/MutableSettings.scala
@@ -17,8 +17,8 @@ abstract class MutableSettings extends AbsSettings {
trait SettingValue extends AbsSettingValue {
protected var v: T = _
protected var setByUser: Boolean = false
- def postSetHook(): Unit = {}
+ def postSetHook(): Unit = ()
def isDefault: Boolean = !setByUser
def value: T = v
def value_=(arg: T) = {
@@ -28,6 +28,7 @@ abstract class MutableSettings extends AbsSettings {
}
}
+ def printtypes: SettingValue { type T = Boolean }
def debug: SettingValue { type T = Boolean }
def YdepMethTpes: SettingValue { type T = Boolean }
def Ynotnull: SettingValue { type T = Boolean }
@@ -35,7 +36,6 @@ abstract class MutableSettings extends AbsSettings {
def verbose: SettingValue { type T = Boolean }
def uniqid: SettingValue { type T = Boolean }
def Xprintpos: SettingValue { type T = Boolean }
- def printtypes: SettingValue { type T = Boolean }
def Yrecursion: SettingValue { type T = Int }
def maxClassfileName: SettingValue { type T = Int }
} \ No newline at end of file
diff --git a/src/compiler/scala/reflect/std/ReflectSettings.scala b/src/compiler/scala/reflect/std/ReflectSettings.scala
index 09e5d2dedb..178f1e5c0c 100644
--- a/src/compiler/scala/reflect/std/ReflectSettings.scala
+++ b/src/compiler/scala/reflect/std/ReflectSettings.scala
@@ -5,8 +5,8 @@ class ReflectSettings extends internal.settings.MutableSettings {
def newSetting[TT](init: TT) = new SettingValue {
type T = TT
- def postSetHook() {}
- var v = init
+
+ v = init
override def isDefault = v == init
}
diff --git a/src/compiler/scala/tools/nsc/settings/MutableSettings.scala b/src/compiler/scala/tools/nsc/settings/MutableSettings.scala
index da66efe1fa..6081b58525 100644
--- a/src/compiler/scala/tools/nsc/settings/MutableSettings.scala
+++ b/src/compiler/scala/tools/nsc/settings/MutableSettings.scala
@@ -322,7 +322,7 @@ class MutableSettings(val errorFn: String => Unit)
abstract class Setting(val name: String, val helpDescription: String) extends AbsSetting with SettingValue with Mutable {
/** Will be called after this Setting is set for any extra work. */
private var _postSetHook: this.type => Unit = (x: this.type) => ()
- def postSetHook(): Unit = _postSetHook(this)
+ override def postSetHook(): Unit = _postSetHook(this)
def withPostSetHook(f: this.type => Unit): this.type = { _postSetHook = f ; this }
/** The syntax defining this setting in a help string */
@@ -354,7 +354,7 @@ class MutableSettings(val errorFn: String => Unit)
parser: String => Option[Int])
extends Setting(name, descr) {
type T = Int
- protected var v = default
+ v = default
// not stable values!
val IntMin = Int.MinValue
@@ -411,7 +411,7 @@ class MutableSettings(val errorFn: String => Unit)
descr: String)
extends Setting(name, descr) {
type T = Boolean
- protected var v = false
+ v = false
def tryToSet(args: List[String]) = { value = true ; Some(args) }
def unparse: List[String] = if (value) List(name) else Nil
@@ -427,7 +427,7 @@ class MutableSettings(val errorFn: String => Unit)
descr: String)
extends Setting(name, descr) {
type T = List[String]
- protected var v: List[String] = Nil
+ v = Nil
def tryToSet(args: List[String]) = args match {
case x :: xs if x startsWith prefix =>
@@ -448,7 +448,7 @@ class MutableSettings(val errorFn: String => Unit)
val default: String)
extends Setting(name, descr) {
type T = String
- protected var v = default
+ v = default
def tryToSet(args: List[String]) = args match {
case Nil => errorAndValue("missing argument", None)
@@ -498,7 +498,7 @@ class MutableSettings(val errorFn: String => Unit)
descr: String)
extends Setting(name, descr) {
type T = List[String]
- protected var v: List[String] = Nil
+ v = Nil
def appendToValue(str: String) { value ++= List(str) }
def tryToSet(args: List[String]) = {
@@ -525,7 +525,7 @@ class MutableSettings(val errorFn: String => Unit)
val default: String)
extends Setting(name, descr + choices.mkString(" (", ",", ") default:" + default)) {
type T = String
- protected var v: String = default
+ v = default
def indexOfChoice: Int = choices indexOf value
private def usageErrorMessage = {
@@ -557,7 +557,7 @@ class MutableSettings(val errorFn: String => Unit)
descr: String)
extends Setting(name, descr + " <phase>.") {
type T = List[String]
- protected var v: List[String] = Nil
+ v = Nil
override def value = if (v contains "all") List("all") else super.value
private lazy val (numericValues, stringValues) =
value filterNot (_ == "" ) partition (_ forall (ch => ch.isDigit || ch == '-'))