private static PsiType validateType(PsiType type, @NotNull PsiElement context) {
    if (PsiTypes.nullType().equals(type)) return null;
    return LambdaUtil.notInferredType(type) || !PsiTypesUtil.isDenotableType(type, context) ? 
           null : TypeConversionUtil.erasure(type);
  }
private static PsiType validateType(PsiType type, @NotNull PsiElement context)