diff options
author | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-06-21 00:23:53 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-06-21 00:23:53 -0700 |
commit | 320827255b736f8405ba3b9a3d5b92947157ba33 (patch) | |
tree | ca36fa1ce5033b0a038378dee52fe019e7ac6370 | |
parent | 16f53506e289ae0b9b97537e01de8fdc985ee4bf (diff) | |
parent | 120766fa33adbbb13bc21d5622a6a30ed6b2b230 (diff) | |
download | scala-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.
-rw-r--r-- | src/continuations/plugin/scala/tools/selectivecps/CPSAnnotationChecker.scala | 4 |
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 } |