summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-12-14 17:54:29 +0000
committerPaul Phillips <paulp@improving.org>2010-12-14 17:54:29 +0000
commitc514c35b2e923f7df865b1ff37b4293a0724c0f4 (patch)
tree711e4fca2f42d1369bac9af283fde1f3632559aa /src
parente671d760128a8afe9de65b282a7998f4ac8e2d9c (diff)
downloadscala-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.scala8
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. */