From 5ee9a14a489c6e56c331914e9db258c0473d4d23 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Thu, 22 Dec 2011 19:35:45 -0800 Subject: 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. --- src/compiler/scala/reflect/internal/SymbolTable.scala | 4 ++-- src/compiler/scala/tools/nsc/Global.scala | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'src/compiler') 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 -- cgit v1.2.3