Skip to content

Commit

Permalink
global.abort calls global.error.
Browse files Browse the repository at this point in the history
Otherwise it is possible (as I discovered the hard way) for
tests running into compiler bugs to be treated as successful
compiles.
  • Loading branch information
paulp committed Dec 23, 2011
1 parent e72e168 commit 5ee9a14
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/compiler/scala/reflect/internal/SymbolTable.scala
Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions src/compiler/scala/tools/nsc/Global.scala
Expand Up @@ -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
Expand Down

0 comments on commit 5ee9a14

Please sign in to comment.