diagnose invalid type (EA-40285)

This commit is contained in:
peter
2012-10-23 14:20:20 +02:00
parent c9b714f829
commit 9a884f86c3
@@ -370,7 +370,9 @@ public class PsiReferenceExpressionImpl extends PsiReferenceExpressionBase imple
if (resolve instanceof PsiVariable) {
PsiType type = ((PsiVariable)resolve).getType();
ret = type instanceof PsiEllipsisType ? ((PsiEllipsisType)type).toArrayType() : type;
LOG.assertTrue(ret == null || ret.isValid());
if (ret != null && !ret.isValid()) {
LOG.error("invalid type of " + resolve + " of class " + resolve.getClass() + ", valid=" + resolve.isValid());
}
if (resolve instanceof PsiField && !((PsiField)resolve).hasModifierProperty(PsiModifier.STATIC)) {
owner = ((PsiField)resolve).getContainingClass();
}