diff options
author | Tiark Rompf <tiark.rompf@epfl.ch> | 2010-03-25 16:14:56 +0000 |
---|---|---|
committer | Tiark Rompf <tiark.rompf@epfl.ch> | 2010-03-25 16:14:56 +0000 |
commit | 1cedf8047ba9820277b2b9e546092918e6e0c7d1 (patch) | |
tree | c1bc414403baccde9a45715ec61609a456786ee1 /src/continuations | |
parent | 63103a5e1a4970d7984d15efe8db4c30fbb56828 (diff) | |
download | scala-1cedf8047ba9820277b2b9e546092918e6e0c7d1.tar.gz scala-1cedf8047ba9820277b2b9e546092918e6e0c7d1.tar.bz2 scala-1cedf8047ba9820277b2b9e546092918e6e0c7d1.zip |
fixed double-loading of plugins.
Diffstat (limited to 'src/continuations')
-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" - } |