From d4748121aa58aa048a751a02d8f9910deab7f915 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Sun, 9 Jan 2011 04:11:43 +0000 Subject: Warded off an NPE (which only arose on erroneou... Warded off an NPE (which only arose on erroneous code) in the continuations plugin. Closes #4132, no review. --- .../plugin/scala/tools/selectivecps/CPSAnnotationChecker.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/continuations/plugin') 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) -- cgit v1.2.3