diff options
4 files changed, 10 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) diff --git a/test/files/run/t4542.check b/test/files/run/t4542.check index cd7a2905e2..a0600ba859 100644 --- a/test/files/run/t4542.check +++ b/test/files/run/t4542.check @@ -15,6 +15,9 @@ scala> val f = new Foo <console>:8: warning: class Foo is deprecated: foooo val f = new Foo ^ +<console>:5: warning: class Foo is deprecated: foooo + lazy val $result = `f` + ^ f: Foo = Bippy scala> |