private @Nullable PsiType calcTypeByParent() {
        if (!parent.isValid()) return null;

        PsiType type = parent instanceof PsiMethod ? ((PsiMethod)parent).getReturnType() : ((PsiVariable)parent).getType();
        if (type instanceof PsiArrayType) { //also, for c-style array, e.g. String args[]
          return type.getDeepComponentType();
        }
        return type;
      }
private @Nullable PsiType calcTypeByParent()