Groovy: don't skip 'null' type in inference

This commit is contained in:
Max Medvedev
2013-12-24 15:43:45 +04:00
parent c482422b77
commit cd70918c3c
2 changed files with 2 additions and 3 deletions
@@ -141,8 +141,7 @@ public interface InferenceContext {
return _getCachedValue(element, new Computable<PsiType>() {
@Override
public PsiType compute() {
PsiType type = calculator.fun(element);
return type == PsiType.NULL ? null : type;
return calculator.fun(element);
}
}, "type");
}
@@ -711,7 +711,7 @@ public class GrReferenceExpressionImpl extends GrReferenceElementImpl<GrExpressi
}
final PsiType inferred = getInferredTypes(refExpr, resolved);
if (inferred == null || PsiType.NULL.equals(inferred)) {
if (inferred == null) {
if (nominal == null) {
//inside nested closure we could still try to infer from variable initializer. Not sound, but makes sense
if (resolved instanceof GrVariable) {