summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Racic <iracic@murex.com>2015-04-13 19:46:21 +0200
committerSom Snytt <som.snytt@gmail.com>2015-06-23 01:09:00 -0700
commit1b9cb466430b6300355185917257493ca2e6a240 (patch)
tree952bd31239a7aac29175ee5e2a08f0720bc1aaf6
parent1fbce4612c21a4d0c553ea489b4765494828c09f (diff)
downloadscala-1b9cb466430b6300355185917257493ca2e6a240.tar.gz
scala-1b9cb466430b6300355185917257493ca2e6a240.tar.bz2
scala-1b9cb466430b6300355185917257493ca2e6a240.zip
SI-9206: No REPL message on :silent, unless -Dscala.repl.info
Anyone who doesn't understand why result printing was turned off after they entered `:silent` mode will start the REPL with `-Dscala.repl.debug` and be enlightened. For infotainment purposes, the verbose message is also emitted under info mode.
-rw-r--r--src/repl/scala/tools/nsc/interpreter/ILoop.scala5
-rw-r--r--test/files/run/t6507.check2
2 files changed, 2 insertions, 5 deletions
diff --git a/src/repl/scala/tools/nsc/interpreter/ILoop.scala b/src/repl/scala/tools/nsc/interpreter/ILoop.scala
index 525609171e..b95789a16d 100644
--- a/src/repl/scala/tools/nsc/interpreter/ILoop.scala
+++ b/src/repl/scala/tools/nsc/interpreter/ILoop.scala
@@ -680,9 +680,8 @@ class ILoop(in0: Option[BufferedReader], protected val out: JPrintWriter)
}
def verbosity() = {
- val old = intp.printResults
- intp.printResults = !old
- echo("Switched " + (if (old) "off" else "on") + " result printing.")
+ intp.printResults = !intp.printResults
+ replinfo(s"Result printing is ${ if (intp.printResults) "on" else "off" }.")
}
/** Run one command submitted by the user. Two values are returned:
diff --git a/test/files/run/t6507.check b/test/files/run/t6507.check
index 5da4aa3a24..3ca5e8e55c 100644
--- a/test/files/run/t6507.check
+++ b/test/files/run/t6507.check
@@ -2,7 +2,6 @@ Type in expressions to have them evaluated.
Type :help for more information.
scala> :silent
-Switched off result printing.
scala> class A { override def toString() = { println("!"); "A" } }
@@ -15,7 +14,6 @@ scala> b = new A
scala> new A
scala> :silent
-Switched on result printing.
scala> res0
!