PsiType (PsiExpression expr) { PsiType type = expr.getType(); PsiClass refClass = PsiUtil.resolveClassInType(type); if (refClass instanceof PsiAnonymousClass) { return ((PsiAnonymousClass)refClass).getBaseClassType(); } return type; }