diff options
author | Paul Phillips <paulp@improving.org> | 2011-12-22 19:35:45 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-12-22 19:35:45 -0800 |
commit | 5ee9a14a489c6e56c331914e9db258c0473d4d23 (patch) | |
tree | 49143e82ab428d3da7d9318688899931aa22190e | |
parent | e72e1686bb8d06937fe93f181fbda5cc6c2041da (diff) | |
download | scala-5ee9a14a489c6e56c331914e9db258c0473d4d23.tar.gz scala-5ee9a14a489c6e56c331914e9db258c0473d4d23.tar.bz2 scala-5ee9a14a489c6e56c331914e9db258c0473d4d23.zip |
global.abort calls global.error.
Otherwise it is possible (as I discovered the hard way) for
tests running into compiler bugs to be treated as successful
compiles.
-rw-r--r-- | src/compiler/scala/reflect/internal/SymbolTable.scala | 4 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/Global.scala | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/compiler/scala/reflect/internal/SymbolTable.scala b/src/compiler/scala/reflect/internal/SymbolTable.scala index 0e9210f1f7..29ac5fe539 100644 --- a/src/compiler/scala/reflect/internal/SymbolTable.scala +++ b/src/compiler/scala/reflect/internal/SymbolTable.scala @@ -31,8 +31,8 @@ abstract class SymbolTable extends api.Universe { def rootLoader: LazyType def log(msg: => AnyRef): Unit - def abort(msg: String): Nothing = throw new Error(msg) - def abort(): Nothing = throw new Error() + def abort(msg: String): Nothing = throw new FatalError(msg) + def abort(): Nothing = abort("unknown error") /** Override with final implementation for inlining. */ def debuglog(msg: => String): Unit = if (settings.debug.value) log(msg) diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala index 90b4da8c9a..f70aa60309 100644 --- a/src/compiler/scala/tools/nsc/Global.scala +++ b/src/compiler/scala/tools/nsc/Global.scala @@ -163,6 +163,12 @@ class Global(var currentSettings: Settings, var reporter: Reporter) extends Symb if (opt.fatalWarnings) globalError(msg) else reporter.warning(NoPosition, msg) + // Needs to call error to make sure the compile fails. + override def abort(msg: String): Nothing = { + error(msg) + super.abort(msg) + } + @inline final def ifDebug(body: => Unit) { if (settings.debug.value) body |