summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorMiguel Garcia <miguelalfredo.garcia@epfl.ch>2012-12-29 14:15:45 +0100
committerMiguel Garcia <miguelalfredo.garcia@epfl.ch>2012-12-29 14:15:45 +0100
commit653b29bfdd091d7e2c069b8ad56f8ca51ad4b244 (patch)
tree47ddd2f1e582f2096fb70f79aad81fa0132eb35e /src/compiler
parentb7840d6b41db910111d73e307c70d32fef0fcee1 (diff)
downloadscala-653b29bfdd091d7e2c069b8ad56f8ca51ad4b244.tar.gz
scala-653b29bfdd091d7e2c069b8ad56f8ca51ad4b244.tar.bz2
scala-653b29bfdd091d7e2c069b8ad56f8ca51ad4b244.zip
nested closures are flattened by calling supplementErrorMessage() directly
A closure C that becomes an argument to the constructor of another closure makes both closures harder to eliminate (either by scalac-optimizer or JIT-compiler) than is the case when C is the argument to an @inline method.
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/tools/nsc/Global.scala6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala
index 95da7324aa..20b8265071 100644
--- a/src/compiler/scala/tools/nsc/Global.scala
+++ b/src/compiler/scala/tools/nsc/Global.scala
@@ -228,13 +228,15 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
// of assert and require (but for now I've reproduced them here,
// because there are a million to fix.)
@inline final def assert(assertion: Boolean, message: => Any) {
- Predef.assert(assertion, supplementErrorMessage("" + message))
+ if (!assertion)
+ throw new java.lang.AssertionError("assertion failed: "+ supplementErrorMessage("" + message))
}
@inline final def assert(assertion: Boolean) {
assert(assertion, "")
}
@inline final def require(requirement: Boolean, message: => Any) {
- Predef.require(requirement, supplementErrorMessage("" + message))
+ if (!requirement)
+ throw new IllegalArgumentException("requirement failed: "+ supplementErrorMessage("" + message))
}
@inline final def require(requirement: Boolean) {
require(requirement, "")