use crate::functions::error_to_string::error_to_string;
use crate::type_aliases::type_error_data::TypeErrorData;
use core::fmt::Write;

pub fn operator_lt_ostream_type_error_data(
    stream: &mut dyn Write,
    data: &TypeErrorData,
) -> core::fmt::Result {
    match data {
        TypeErrorData::TypeMismatch(e) => error_to_string(stream, e),
        TypeErrorData::UnknownSymbol(e) => error_to_string(stream, e),
        TypeErrorData::UnknownProperty(e) => error_to_string(stream, e),
        TypeErrorData::NotATable(e) => error_to_string(stream, e),
        TypeErrorData::CannotExtendTable(e) => error_to_string(stream, e),
        TypeErrorData::CannotCompareUnrelatedTypes(e) => error_to_string(stream, e),
        TypeErrorData::OnlyTablesCanHaveMethods(e) => error_to_string(stream, e),
        TypeErrorData::DuplicateTypeDefinition(e) => error_to_string(stream, e),
        TypeErrorData::CountMismatch(e) => error_to_string(stream, e),
        TypeErrorData::FunctionDoesNotTakeSelf(e) => error_to_string(stream, e),
        TypeErrorData::FunctionRequiresSelf(e) => error_to_string(stream, e),
        TypeErrorData::OccursCheckFailed(e) => error_to_string(stream, e),
        TypeErrorData::UnknownRequire(e) => error_to_string(stream, e),
        TypeErrorData::IncorrectGenericParameterCount(e) => error_to_string(stream, e),
        TypeErrorData::SyntaxError(e) => error_to_string(stream, e),
        TypeErrorData::CodeTooComplex(e) => error_to_string(stream, e),
        TypeErrorData::UnificationTooComplex(e) => error_to_string(stream, e),
        TypeErrorData::UnknownPropButFoundLikeProp(e) => error_to_string(stream, e),
        TypeErrorData::GenericError(e) => error_to_string(stream, e),
        TypeErrorData::InternalError(e) => error_to_string(stream, e),
        TypeErrorData::ConstraintSolvingIncompleteError(e) => error_to_string(stream, e),
        TypeErrorData::CannotCallNonFunction(e) => error_to_string(stream, e),
        TypeErrorData::ExtraInformation(e) => error_to_string(stream, e),
        TypeErrorData::DeprecatedApiUsed(e) => error_to_string(stream, e),
        TypeErrorData::ModuleHasCyclicDependency(e) => error_to_string(stream, e),
        TypeErrorData::IllegalRequire(e) => error_to_string(stream, e),
        TypeErrorData::FunctionExitsWithoutReturning(e) => error_to_string(stream, e),
        TypeErrorData::DuplicateGenericParameter(e) => error_to_string(stream, e),
        TypeErrorData::CannotAssignToNever(e) => error_to_string(stream, e),
        TypeErrorData::CannotInferBinaryOperation(e) => error_to_string(stream, e),
        TypeErrorData::MissingProperties(e) => error_to_string(stream, e),
        TypeErrorData::SwappedGenericTypeParameter(e) => error_to_string(stream, e),
        TypeErrorData::OptionalValueAccess(e) => error_to_string(stream, e),
        TypeErrorData::MissingUnionProperty(e) => error_to_string(stream, e),
        TypeErrorData::TypesAreUnrelated(e) => error_to_string(stream, e),
        TypeErrorData::NormalizationTooComplex(e) => error_to_string(stream, e),
        TypeErrorData::TypePackMismatch(e) => error_to_string(stream, e),
        TypeErrorData::DynamicPropertyLookupOnExternTypesUnsafe(e) => error_to_string(stream, e),
        TypeErrorData::UninhabitedTypeFunction(e) => error_to_string(stream, e),
        TypeErrorData::UninhabitedTypePackFunction(e) => error_to_string(stream, e),
        TypeErrorData::WhereClauseNeeded(e) => error_to_string(stream, e),
        TypeErrorData::PackWhereClauseNeeded(e) => error_to_string(stream, e),
        TypeErrorData::CheckedFunctionCallError(e) => error_to_string(stream, e),
        TypeErrorData::NonStrictFunctionDefinitionError(e) => error_to_string(stream, e),
        TypeErrorData::PropertyAccessViolation(e) => error_to_string(stream, e),
        TypeErrorData::CheckedFunctionIncorrectArgs(e) => error_to_string(stream, e),
        TypeErrorData::UnexpectedTypeInSubtyping(e) => error_to_string(stream, e),
        TypeErrorData::UnexpectedTypePackInSubtyping(e) => error_to_string(stream, e),
        TypeErrorData::ExplicitFunctionAnnotationRecommended(e) => error_to_string(stream, e),
        TypeErrorData::UserDefinedTypeFunctionError(e) => error_to_string(stream, e),
        TypeErrorData::BuiltInTypeFunctionError(e) => error_to_string(stream, e),
        TypeErrorData::ReservedIdentifier(e) => error_to_string(stream, e),
        TypeErrorData::UnexpectedArrayLikeTableItem(e) => error_to_string(stream, e),
        TypeErrorData::CannotCheckDynamicStringFormatCalls(e) => error_to_string(stream, e),
        TypeErrorData::GenericTypeCountMismatch(e) => error_to_string(stream, e),
        TypeErrorData::GenericTypePackCountMismatch(e) => error_to_string(stream, e),
        TypeErrorData::MultipleNonviableOverloads(e) => error_to_string(stream, e),
        TypeErrorData::RecursiveRestraintViolation(e) => error_to_string(stream, e),
        TypeErrorData::GenericBoundsMismatch(e) => error_to_string(stream, e),
        TypeErrorData::UnappliedTypeFunction(e) => error_to_string(stream, e),
        TypeErrorData::InstantiateGenericsOnNonFunction(e) => error_to_string(stream, e),
        TypeErrorData::TypeInstantiationCountMismatch(e) => error_to_string(stream, e),
        TypeErrorData::AmbiguousFunctionCall(e) => error_to_string(stream, e),
    }
}

#[allow(unused_imports, non_snake_case)]
pub use operator_lt_ostream_type_error_data as operator_lt;
