diff options
author | Tiark Rompf <tiark.rompf@epfl.ch> | 2010-03-24 17:55:15 +0000 |
---|---|---|
committer | Tiark Rompf <tiark.rompf@epfl.ch> | 2010-03-24 17:55:15 +0000 |
commit | c968d3179fd68d9a5eaa2ac41ce5656f66d16baa (patch) | |
tree | 491a742ea09952bbf214de75cb767eea174eabc7 /src | |
parent | 040e4480b50fb1664b521b99f7b17c403c117fd3 (diff) | |
download | scala-c968d3179fd68d9a5eaa2ac41ce5656f66d16baa.tar.gz scala-c968d3179fd68d9a5eaa2ac41ce5656f66d16baa.tar.bz2 scala-c968d3179fd68d9a5eaa2ac41ce5656f66d16baa.zip |
continuations plugin will now report a nice err...
continuations plugin will now report a nice error message if it is not
enabled and encounters an @cps expression. review by rytz
Diffstat (limited to 'src')
-rw-r--r-- | src/continuations/plugin/scala/tools/selectivecps/CPSAnnotationChecker.scala | 6 |
1 files changed, 5 insertions, 1 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) |