diff options
Diffstat (limited to 'src/continuations')
-rw-r--r-- | src/continuations/plugin/scala/tools/selectivecps/CPSAnnotationChecker.scala | 5 | ||||
-rw-r--r-- | src/continuations/plugin/scala/tools/selectivecps/SelectiveCPSTransform.scala | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/continuations/plugin/scala/tools/selectivecps/CPSAnnotationChecker.scala b/src/continuations/plugin/scala/tools/selectivecps/CPSAnnotationChecker.scala index 5151f1eeee..2df538fe85 100644 --- a/src/continuations/plugin/scala/tools/selectivecps/CPSAnnotationChecker.scala +++ b/src/continuations/plugin/scala/tools/selectivecps/CPSAnnotationChecker.scala @@ -373,9 +373,10 @@ abstract class CPSAnnotationChecker extends CPSUtils { transChildrenInOrder(tree, tpe, qual::(transArgList(fun, args).flatten), Nil) case TypeApply(fun @ Select(qual, name), args) if fun.isTyped => + def stripNullaryMethodType(tp: Type) = tp match { case NullaryMethodType(restpe) => restpe case tp => tp } vprintln("[checker] checking select apply " + tree + "/" + tpe) - transChildrenInOrder(tree, tpe, List(qual, fun), Nil) + transChildrenInOrder(tree, stripNullaryMethodType(tpe), List(qual, fun), Nil) case Apply(fun, args) if fun.isTyped => @@ -406,7 +407,7 @@ abstract class CPSAnnotationChecker extends CPSUtils { // we have to do it here so we don't lose the cps information (wouldn't trigger our // adapt and there is no Apply/TypeApply created) tpe match { - case PolyType(List(), restpe) => + case NullaryMethodType(restpe) => //println("yep: " + restpe + "," + restpe.getClass) transChildrenInOrder(tree, restpe, List(qual), Nil) case _ : PolyType => tpe diff --git a/src/continuations/plugin/scala/tools/selectivecps/SelectiveCPSTransform.scala b/src/continuations/plugin/scala/tools/selectivecps/SelectiveCPSTransform.scala index 07a9e5fed5..78cc8f7ff7 100644 --- a/src/continuations/plugin/scala/tools/selectivecps/SelectiveCPSTransform.scala +++ b/src/continuations/plugin/scala/tools/selectivecps/SelectiveCPSTransform.scala @@ -50,8 +50,8 @@ abstract class SelectiveCPSTransform extends PluginComponent with def transformCPSType(tp: Type): Type = { // TODO: use a TypeMap? need to handle more cases? tp match { case PolyType(params,res) => PolyType(params, transformCPSType(res)) - case MethodType(params,res) => - MethodType(params, transformCPSType(res)) + case NullaryMethodType(res) => NullaryMethodType(transformCPSType(res)) + case MethodType(params,res) => MethodType(params, transformCPSType(res)) case TypeRef(pre, sym, args) => TypeRef(pre, sym, args.map(transformCPSType(_))) case _ => getExternalAnswerTypeAnn(tp) match { |