summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/tools/nsc/ast/Trees.scala1
-rw-r--r--src/continuations/plugin/scala/tools/selectivecps/CPSAnnotationChecker.scala8
2 files changed, 5 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/Trees.scala b/src/compiler/scala/tools/nsc/ast/Trees.scala
index 25c053c36d..30af9b0e8e 100644
--- a/src/compiler/scala/tools/nsc/ast/Trees.scala
+++ b/src/compiler/scala/tools/nsc/ast/Trees.scala
@@ -59,6 +59,7 @@ trait Trees extends reflect.generic.Trees { self: SymbolTable =>
}
def isErroneous = (tree.tpe ne null) && tree.tpe.isErroneous
+ def isTyped = (tree.tpe ne null) && !tree.tpe.isErroneous
/** Apply `f' to each subtree */
def foreach(f: Tree => Unit) { new ForeachTreeTraverser(f).traverse(tree) }
diff --git a/src/continuations/plugin/scala/tools/selectivecps/CPSAnnotationChecker.scala b/src/continuations/plugin/scala/tools/selectivecps/CPSAnnotationChecker.scala
index 9f38b9c15a..5151f1eeee 100644
--- a/src/continuations/plugin/scala/tools/selectivecps/CPSAnnotationChecker.scala
+++ b/src/continuations/plugin/scala/tools/selectivecps/CPSAnnotationChecker.scala
@@ -362,7 +362,7 @@ abstract class CPSAnnotationChecker extends CPSUtils {
tree match {
- case Apply(fun @ Select(qual, name), args) if (fun.tpe ne null) && !fun.tpe.isErroneous =>
+ case Apply(fun @ Select(qual, name), args) if fun.isTyped =>
// HACK: With overloaded methods, fun will never get annotated. This is because
// the 'overloaded' type gets annotated, but not the alternatives (among which
@@ -372,12 +372,12 @@ abstract class CPSAnnotationChecker extends CPSUtils {
transChildrenInOrder(tree, tpe, qual::(transArgList(fun, args).flatten), Nil)
- case TypeApply(fun @ Select(qual, name), args) if (fun.tpe ne null) && !fun.tpe.isErroneous =>
+ case TypeApply(fun @ Select(qual, name), args) if fun.isTyped =>
vprintln("[checker] checking select apply " + tree + "/" + tpe)
transChildrenInOrder(tree, tpe, List(qual, fun), Nil)
- case Apply(fun, args) if (fun.tpe ne null) && !fun.tpe.isErroneous =>
+ case Apply(fun, args) if fun.isTyped =>
vprintln("[checker] checking unknown apply " + tree + "/" + tpe)
@@ -389,7 +389,7 @@ abstract class CPSAnnotationChecker extends CPSUtils {
transChildrenInOrder(tree, tpe, List(fun), Nil)
- case Select(qual, name) =>
+ case Select(qual, name) if qual.isTyped =>
vprintln("[checker] checking select " + tree + "/" + tpe)