diff options
author | Paul Phillips <paulp@improving.org> | 2010-12-14 17:54:29 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-12-14 17:54:29 +0000 |
commit | c514c35b2e923f7df865b1ff37b4293a0724c0f4 (patch) | |
tree | 711e4fca2f42d1369bac9af283fde1f3632559aa /src | |
parent | e671d760128a8afe9de65b282a7998f4ac8e2d9c (diff) | |
download | scala-c514c35b2e923f7df865b1ff37b4293a0724c0f4.tar.gz scala-c514c35b2e923f7df865b1ff37b4293a0724c0f4.tar.bz2 scala-c514c35b2e923f7df865b1ff37b4293a0724c0f4.zip |
More repl hardening against its fickle master, ...
More repl hardening against its fickle master, Global. No review.
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/Interpreter.scala | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/Interpreter.scala b/src/compiler/scala/tools/nsc/Interpreter.scala index 44dd0698d1..9fa77baeac 100644 --- a/src/compiler/scala/tools/nsc/Interpreter.scala +++ b/src/compiler/scala/tools/nsc/Interpreter.scala @@ -284,6 +284,10 @@ class Interpreter(val settings: Settings, out: PrintWriter) { def handleTermRedefinition(name: TermName, old: Request, req: Request) = { for (t1 <- old.compilerTypeOf get name ; t2 <- req.compilerTypeOf get name) { + // Printing the types here has a tendency to cause assertion errors, like + // assertion failed: fatal: <refinement> has owner value x, but a class owner is required + // so DBG is by-name now to keep it in the family. (It also traps the assertion error, + // but we don't want to unnecessarily risk hosing the compiler's internal state.) DBG("Redefining term '%s'\n %s -> %s".format(name, t1, t2)) } } @@ -1303,7 +1307,9 @@ class Interpreter(val settings: Settings, out: PrintWriter) { // debugging def isCompletionDebug = settings.Ycompletion.value - def DBG(s: String) = repldbg(s) + def DBG(s: => String) = + try if (isReplDebug) repldbg(s) + catch { case x: AssertionError => repldbg("Assertion error printing debug string:\n " + x) } } /** Utility methods for the Interpreter. */ |