summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-04-12 21:37:51 +0100
committerPaul Phillips <paulp@improving.org>2012-04-12 21:56:21 +0100
commit90960a13840a0b64590d70c49234e71668834f87 (patch)
tree0dff5730e8593375625e972c19e7675ce173d123 /src
parent08505bd4ec1216be7913607b84e54942f9153329 (diff)
downloadscala-90960a13840a0b64590d70c49234e71668834f87.tar.gz
scala-90960a13840a0b64590d70c49234e71668834f87.tar.bz2
scala-90960a13840a0b64590d70c49234e71668834f87.zip
Workaround for SI-5657.
Changes to error handling have had unfortunate effects on the repl. Disabling things which used to work to suppress new failures.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/reflect/internal/SymbolTable.scala7
-rw-r--r--src/compiler/scala/tools/nsc/interpreter/JLineCompletion.scala5
-rw-r--r--src/compiler/scala/tools/nsc/interpreter/ReplConfig.scala6
3 files changed, 18 insertions, 0 deletions
diff --git a/src/compiler/scala/reflect/internal/SymbolTable.scala b/src/compiler/scala/reflect/internal/SymbolTable.scala
index ffc8178528..5ed37c04ad 100644
--- a/src/compiler/scala/reflect/internal/SymbolTable.scala
+++ b/src/compiler/scala/reflect/internal/SymbolTable.scala
@@ -52,6 +52,13 @@ abstract class SymbolTable extends api.Universe
/** Overridden when we know more about what was happening during a failure. */
def supplementErrorMessage(msg: String): String = msg
+
+ private[scala] def printCaller[T](msg: String)(result: T) = {
+ Console.err.println(msg + ": " + result)
+ Console.err.println("Called from:")
+ (new Throwable).getStackTrace.drop(2).take(15).foreach(Console.err.println)
+ result
+ }
private[scala] def printResult[T](msg: String)(result: T) = {
Console.err.println(msg + ": " + result)
diff --git a/src/compiler/scala/tools/nsc/interpreter/JLineCompletion.scala b/src/compiler/scala/tools/nsc/interpreter/JLineCompletion.scala
index f9c1907696..a86462ad5f 100644
--- a/src/compiler/scala/tools/nsc/interpreter/JLineCompletion.scala
+++ b/src/compiler/scala/tools/nsc/interpreter/JLineCompletion.scala
@@ -287,7 +287,12 @@ class JLineCompletion(val intp: IMain) extends Completion with CompletionOutput
}
// chasing down results which won't parse
+ // This used to work fine, now it reports a type error before any
+ // exception gets to us. See SI-5657. Don't have time to deal with
+ // it, so disabling everything.
def execute(line: String): Option[ExecResult] = {
+ return None // disabled
+
val parsed = Parsed(line)
def noDotOrSlash = line forall (ch => ch != '.' && ch != '/')
diff --git a/src/compiler/scala/tools/nsc/interpreter/ReplConfig.scala b/src/compiler/scala/tools/nsc/interpreter/ReplConfig.scala
index 8c589eba60..0c26aa8b28 100644
--- a/src/compiler/scala/tools/nsc/interpreter/ReplConfig.scala
+++ b/src/compiler/scala/tools/nsc/interpreter/ReplConfig.scala
@@ -27,6 +27,12 @@ trait ReplConfig {
try Console println msg
catch { case x: AssertionError => Console.println("Assertion error printing debugging output: " + x) }
+ private[nsc] def repldbgex(ex: Throwable): Unit = {
+ if (isReplDebug) {
+ echo("Caught/suppressing: " + ex)
+ ex.printStackTrace
+ }
+ }
private[nsc] def repldbg(msg: => String) = if (isReplDebug) echo(msg)
private[nsc] def repltrace(msg: => String) = if (isReplTrace) echo(msg)
private[nsc] def replinfo(msg: => String) = if (isReplInfo) echo(msg)