summaryrefslogtreecommitdiff
path: root/src/continuations
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@epfl.ch>2012-06-21 00:23:53 -0700
committerAdriaan Moors <adriaan.moors@epfl.ch>2012-06-21 00:23:53 -0700
commit320827255b736f8405ba3b9a3d5b92947157ba33 (patch)
treeca36fa1ce5033b0a038378dee52fe019e7ac6370 /src/continuations
parent16f53506e289ae0b9b97537e01de8fdc985ee4bf (diff)
parent120766fa33adbbb13bc21d5622a6a30ed6b2b230 (diff)
downloadscala-320827255b736f8405ba3b9a3d5b92947157ba33.tar.gz
scala-320827255b736f8405ba3b9a3d5b92947157ba33.tar.bz2
scala-320827255b736f8405ba3b9a3d5b92947157ba33.zip
Merge pull request #711 from dragos/issue/no-crash-missing-cpsParam
Don't crash if cpsParam is not on the classpath.
Diffstat (limited to 'src/continuations')
-rw-r--r--src/continuations/plugin/scala/tools/selectivecps/CPSAnnotationChecker.scala4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/continuations/plugin/scala/tools/selectivecps/CPSAnnotationChecker.scala b/src/continuations/plugin/scala/tools/selectivecps/CPSAnnotationChecker.scala
index 5b8e9baa21..464ffc6fab 100644
--- a/src/continuations/plugin/scala/tools/selectivecps/CPSAnnotationChecker.scala
+++ b/src/continuations/plugin/scala/tools/selectivecps/CPSAnnotationChecker.scala
@@ -4,6 +4,7 @@ package scala.tools.selectivecps
import scala.tools.nsc.Global
import scala.tools.nsc.typechecker.Modes
+import scala.tools.nsc.MissingRequirementError
abstract class CPSAnnotationChecker extends CPSUtils with Modes {
val global: Global
@@ -366,8 +367,9 @@ abstract class CPSAnnotationChecker extends CPSUtils with Modes {
* for a tree. All this should do is add annotations. */
override def addAnnotations(tree: Tree, tpe: Type): Type = {
+ import scala.util.control._
if (!cpsEnabled) {
- if (hasCpsParamTypes(tpe))
+ if (Exception.failAsValue(classOf[MissingRequirementError])(false)(hasCpsParamTypes(tpe)))
global.reporter.error(tree.pos, "this code must be compiled with the Scala continuations plugin enabled")
return tpe
}