summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/io
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-01-26 08:40:04 -0800
committerPaul Phillips <paulp@improving.org>2012-01-26 11:26:36 -0800
commit67420a8fa31c4570542450238b97e5ca1b54a86f (patch)
tree49d2760b1267c732eba1e06eb03140428a6379a0 /src/compiler/scala/tools/nsc/io
parenta7aeddd038bead9cda67a85a922a7988b459ff04 (diff)
downloadscala-67420a8fa31c4570542450238b97e5ca1b54a86f.tar.gz
scala-67420a8fa31c4570542450238b97e5ca1b54a86f.tar.bz2
scala-67420a8fa31c4570542450238b97e5ca1b54a86f.zip
Intercept assert and require calls.
And abort calls, and unhandled exceptions, all so I can supplement the error message with a little of the vast quantity of useful information which we possess but do not reveal. "Details are sketchy," says the officer tasked with investigating the crash, but no longer. Also took the opportunity to eliminate a bunch of one-argument assertions and requirements if I thought there was any chance I'd someday be facing them on the wrong end of an incident. Have you ever dreamed that instead of this experience: % scalac -optimise <long list of files> error: java.lang.AssertionError: assertion failed: Record Record(anonymous class JavaToScala$$anonfun$makeScalaPackage$1,Map()) does not contain a field value owner$1 Things could proceed more like this: % scalac -optimise <long list of files> error: while compiling: src/compiler/scala/reflect/runtime/JavaToScala.scala current phase: closelim library version: version 2.10.0.rdev-4267-2012-01-25-gc94d342 compiler version: version 2.10.0.rdev-4270-2012-01-26-gd540ddf reconstructed args: -Ydead-code -optimise -Yinline -Yclosure-elim -Yinline-handlers -d /tmp error: java.lang.AssertionError: [etc] You are not dreaming! IT'S ALL HAPPENING
Diffstat (limited to 'src/compiler/scala/tools/nsc/io')
-rw-r--r--src/compiler/scala/tools/nsc/io/AbstractFile.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/io/AbstractFile.scala b/src/compiler/scala/tools/nsc/io/AbstractFile.scala
index 494eb4d50b..b51cf1228c 100644
--- a/src/compiler/scala/tools/nsc/io/AbstractFile.scala
+++ b/src/compiler/scala/tools/nsc/io/AbstractFile.scala
@@ -211,7 +211,7 @@ abstract class AbstractFile extends AnyRef with Iterable[AbstractFile] {
var start = 0
while (true) {
val index = path.indexOf(separator, start)
- assert(index < 0 || start < index)
+ assert(index < 0 || start < index, ((path, directory, start, index)))
val name = path.substring(start, if (index < 0) length else index)
file = getFile(file, name, if (index < 0) directory else true)
if ((file eq null) || index < 0) return file