public static boolean containsErrorType(@Nullable JetType type) { if (type == null) return false; if (type.isError()) return true; for (TypeProjection projection : type.getArguments()) { if (containsErrorType(projection.getType())) return true; } return false; }
public static JetType createWrongVarianceErrorType(TypeProjection value) { return createErrorType(value + " is not allowed here", value.getType().getMemberScope()); }