diff options
Diffstat (limited to 'src/continuations/plugin')
-rw-r--r-- | src/continuations/plugin/scala/tools/selectivecps/CPSAnnotationChecker.scala | 6 | ||||
-rw-r--r-- | src/continuations/plugin/scala/tools/selectivecps/SelectiveCPSPlugin.scala | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/continuations/plugin/scala/tools/selectivecps/CPSAnnotationChecker.scala b/src/continuations/plugin/scala/tools/selectivecps/CPSAnnotationChecker.scala index 6acc685dc2..a1112fa3c8 100644 --- a/src/continuations/plugin/scala/tools/selectivecps/CPSAnnotationChecker.scala +++ b/src/continuations/plugin/scala/tools/selectivecps/CPSAnnotationChecker.scala @@ -380,7 +380,11 @@ abstract class CPSAnnotationChecker extends CPSUtils { * for a tree. All this should do is add annotations. */ override def addAnnotations(tree: Tree, tpe: Type): Type = { - if (!cpsEnabled) return tpe + if (!cpsEnabled) { + if (tpe.hasAnnotation(MarkerCPSTypes)) + global.reporter.error(tree.pos, "this code must be compiled with the Scala continuations plugin enabled") + return tpe + } // if (tree.tpe.hasAnnotation(MarkerCPSAdaptPlus)) // println("addAnnotation " + tree + "/" + tpe) diff --git a/src/continuations/plugin/scala/tools/selectivecps/SelectiveCPSPlugin.scala b/src/continuations/plugin/scala/tools/selectivecps/SelectiveCPSPlugin.scala index 7c56a78491..a16e9b9a4c 100644 --- a/src/continuations/plugin/scala/tools/selectivecps/SelectiveCPSPlugin.scala +++ b/src/continuations/plugin/scala/tools/selectivecps/SelectiveCPSPlugin.scala @@ -33,6 +33,7 @@ class SelectiveCPSPlugin(val global: Global) extends Plugin { } global.addAnnotationChecker(checker.checker) + global.log("instantiated cps plugin: " + this) def setEnabled(flag: Boolean) = { checker.cpsEnabled = flag @@ -56,6 +57,4 @@ class SelectiveCPSPlugin(val global: Global) extends Plugin { override val optionsHelp: Option[String] = Some(" -P:continuations:enable Enable continuations") -// " -sourcepath <path> Specify where to find input source files" - } |