public static boolean canInferType(@NotNull PsiTypeElement typeElement) {
    final PsiElement parent = typeElement.getParent();
    return (parent instanceof PsiLocalVariable && isValOrVar((PsiLocalVariable) parent)) ||
      (parent instanceof PsiParameter && isValOrVarForEach((PsiParameter) parent));
  }
public static boolean canInferType(@NotNull PsiTypeElement typeElement)