diff options
author | Paul Phillips <paulp@improving.org> | 2012-02-12 06:40:54 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-02-12 08:37:03 -0800 |
commit | 5133a89556b5194dc53e396168eab73ab7d52e9c (patch) | |
tree | 3be8e90744db1713d036b94a091c76123c85b543 /src | |
parent | 0de6e8a7a72a52e78ab7ef158dbc1f3fd3e9eae6 (diff) | |
download | scala-5133a89556b5194dc53e396168eab73ab7d52e9c.tar.gz scala-5133a89556b5194dc53e396168eab73ab7d52e9c.tar.bz2 scala-5133a89556b5194dc53e396168eab73ab7d52e9c.zip |
Fix for overly suppressive repl.
At some point in the past, trying to prevent deprection warnings from
being issue in triplicate in the repl, I suppressed too much output,
leading to a class of breakdowns where the failure would be swallowed
completely. This went on for far too long. The deprecation warnings
are back in triplicate for the moment, but the repl should now be less
"strong, silent type" and more emo.
Diffstat (limited to 'src')
3 files changed, 7 insertions, 8 deletions
diff --git a/src/compiler/scala/tools/nsc/interpreter/ExprTyper.scala b/src/compiler/scala/tools/nsc/interpreter/ExprTyper.scala index 9f5fde70d8..39a1a406ba 100644 --- a/src/compiler/scala/tools/nsc/interpreter/ExprTyper.scala +++ b/src/compiler/scala/tools/nsc/interpreter/ExprTyper.scala @@ -62,7 +62,7 @@ trait ExprTyper { else Some(trees) } } - def tokens(line: String) = beSilentDuring(codeParser.tokens(line)) + def tokens(line: String) = beQuietDuring(codeParser.tokens(line)) // TODO: integrate these into a CodeHandler[Type]. diff --git a/src/compiler/scala/tools/nsc/interpreter/IMain.scala b/src/compiler/scala/tools/nsc/interpreter/IMain.scala index 6ae8d0e7d0..de408f083f 100644 --- a/src/compiler/scala/tools/nsc/interpreter/IMain.scala +++ b/src/compiler/scala/tools/nsc/interpreter/IMain.scala @@ -906,11 +906,7 @@ class IMain(initialSettings: Settings, protected val out: JPrintWriter) extends if (!handlers.last.definesValue) "" else handlers.last.definesTerm match { case Some(vname) if typeOf contains vname => - """ - |lazy val %s = { - | %s - | %s - |}""".stripMargin.format(lineRep.resultName, lineRep.printName, fullPath(vname)) + "lazy val %s = %s".format(lineRep.resultName, fullPath(vname)) case _ => "" } // first line evaluates object to make sure constructor is run @@ -956,7 +952,7 @@ class IMain(initialSettings: Settings, protected val out: JPrintWriter) extends typesOfDefinedTerms // compile the result-extraction object - beSilentDuring { + beQuietDuring { savingSettings(_.nowarn.value = true) { lineRep compile ResultObjectSourceCode(handlers) } diff --git a/src/compiler/scala/tools/nsc/interpreter/ReplReporter.scala b/src/compiler/scala/tools/nsc/interpreter/ReplReporter.scala index dac20ad348..130af990ad 100644 --- a/src/compiler/scala/tools/nsc/interpreter/ReplReporter.scala +++ b/src/compiler/scala/tools/nsc/interpreter/ReplReporter.scala @@ -14,7 +14,10 @@ class ReplReporter(intp: IMain) extends ConsoleReporter(intp.settings, Console.i // Avoiding deadlock if the compiler starts logging before // the lazy val is complete. if (intp.isInitializeComplete) { - if (intp.totalSilence) () + if (intp.totalSilence) { + if (isReplTrace) + super.printMessage("[silent] " + msg) + } else super.printMessage(msg) } else Console.println("[init] " + msg) |