summaryrefslogtreecommitdiff
path: root/src/interactive/scala/tools
diff options
context:
space:
mode:
authorSom Snytt <som.snytt@gmail.com>2013-03-26 02:13:13 -0700
committerPaul Phillips <paulp@improving.org>2013-03-27 10:39:22 -0700
commit22944e474e038f11ac110661eb7e5edbea5d6d13 (patch)
tree10a50240110d17acbb46f3ba09ff98e2a6465f7d /src/interactive/scala/tools
parente073975997a5291cbe76ea15e797a6783bb4d544 (diff)
downloadscala-22944e474e038f11ac110661eb7e5edbea5d6d13.tar.gz
scala-22944e474e038f11ac110661eb7e5edbea5d6d13.tar.bz2
scala-22944e474e038f11ac110661eb7e5edbea5d6d13.zip
SI-7261 Implicit conversion of BooleanSetting to Boolean and BooleanFlag
This commit shortens expressions of the form `if (settings.debug.value)` to `if (settings.debug)` for various settings. Rarely, the setting is supplied as a method argument. The conversion is not employed in simple definitions where the Boolean type would have to be specified.
Diffstat (limited to 'src/interactive/scala/tools')
-rw-r--r--src/interactive/scala/tools/nsc/interactive/Global.scala2
-rw-r--r--src/interactive/scala/tools/nsc/interactive/Main.scala2
-rw-r--r--src/interactive/scala/tools/nsc/interactive/REPL.scala4
-rw-r--r--src/interactive/scala/tools/nsc/interactive/tests/Tester.scala4
4 files changed, 6 insertions, 6 deletions
diff --git a/src/interactive/scala/tools/nsc/interactive/Global.scala b/src/interactive/scala/tools/nsc/interactive/Global.scala
index 099a882f10..dbdb2d02b6 100644
--- a/src/interactive/scala/tools/nsc/interactive/Global.scala
+++ b/src/interactive/scala/tools/nsc/interactive/Global.scala
@@ -547,7 +547,7 @@ class Global(settings: Settings, _reporter: Reporter, projectName: String = "")
for (s <- allSources; if !ignoredFiles(s.file); unit <- getUnit(s)) {
try {
if (!unit.isUpToDate)
- if (unit.problems.isEmpty || !settings.YpresentationStrict.value)
+ if (unit.problems.isEmpty || !settings.YpresentationStrict)
typeCheck(unit)
else debugLog("%s has syntax errors. Skipped typechecking".format(unit))
else debugLog("already up to date: "+unit)
diff --git a/src/interactive/scala/tools/nsc/interactive/Main.scala b/src/interactive/scala/tools/nsc/interactive/Main.scala
index 3b4a36f62d..c838606f02 100644
--- a/src/interactive/scala/tools/nsc/interactive/Main.scala
+++ b/src/interactive/scala/tools/nsc/interactive/Main.scala
@@ -12,7 +12,7 @@ package interactive
*/
object Main extends nsc.MainClass {
override def processSettingsHook(): Boolean = {
- if (this.settings.Yidedebug.value) {
+ if (this.settings.Yidedebug) {
this.settings.Xprintpos.value = true
this.settings.Yrangepos.value = true
val compiler = new interactive.Global(this.settings, this.reporter)
diff --git a/src/interactive/scala/tools/nsc/interactive/REPL.scala b/src/interactive/scala/tools/nsc/interactive/REPL.scala
index 04c06b9357..432400ecd2 100644
--- a/src/interactive/scala/tools/nsc/interactive/REPL.scala
+++ b/src/interactive/scala/tools/nsc/interactive/REPL.scala
@@ -32,7 +32,7 @@ object REPL {
val settings = new Settings(replError)
reporter = new ConsoleReporter(settings)
val command = new CompilerCommand(args.toList, settings)
- if (command.settings.version.value)
+ if (command.settings.version)
reporter.echo(versionMsg)
else {
try {
@@ -50,7 +50,7 @@ object REPL {
}
} catch {
case ex @ FatalError(msg) =>
- if (true || command.settings.debug.value) // !!!
+ if (true || command.settings.debug) // !!!
ex.printStackTrace()
reporter.error(null, "fatal error: " + msg)
}
diff --git a/src/interactive/scala/tools/nsc/interactive/tests/Tester.scala b/src/interactive/scala/tools/nsc/interactive/tests/Tester.scala
index 9382d5890f..8a47c1df37 100644
--- a/src/interactive/scala/tools/nsc/interactive/tests/Tester.scala
+++ b/src/interactive/scala/tools/nsc/interactive/tests/Tester.scala
@@ -17,7 +17,7 @@ class Tester(ntests: Int, inputs: Array[SourceFile], settings: Settings) {
val compiler = new Global(settings, reporter)
def askAndListen[T, U](msg: String, arg: T, op: (T, Response[U]) => Unit) {
- if (settings.verbose.value) print(msg+" "+arg+": ")
+ if (settings.verbose) print(msg+" "+arg+": ")
val TIMEOUT = 10 // ms
val limit = System.currentTimeMillis() + randomDelayMillis
val res = new Response[U]
@@ -28,7 +28,7 @@ class Tester(ntests: Int, inputs: Array[SourceFile], settings: Settings) {
} else res.get(TIMEOUT) match {
case Some(Left(t)) =>
/**/
- if (settings.verbose.value) println(t)
+ if (settings.verbose) println(t)
case Some(Right(ex)) =>
ex.printStackTrace()
println(ex)